Exemplo n.º 1
0
Arquivo: Table.php Projeto: chh/sirel
 /**
  * Returns a new Update Manager
  * @return UpdateManager
  */
 function update()
 {
     $updateManager = new UpdateManager();
     return $updateManager->table($this);
 }
Exemplo n.º 2
0
 /**
  * Compiles an Update Query from the restrictions, orders, limits,
  * and offsets of this Select Query.
  *
  * @return UpdateManager
  */
 function compileUpdate()
 {
     $updateManager = new UpdateManager();
     $updateManager->table($this->nodes->source->getLeft());
     foreach ($this->nodes->restrictions as $expr) {
         $updateManager->where($expr);
     }
     foreach ($this->nodes->orders as $order) {
         $updateManager->order($order);
     }
     empty($this->nodes->limit) ?: $updateManager->take($this->nodes->limit->getExpression());
     empty($this->nodes->offset) ?: $updateManager->skip($this->nodes->offset->getExpression());
     return $updateManager;
 }