Exemplo n.º 1
0
 public function hydrate(Statement $statement)
 {
     $selectionFactory = $this->selection->getSelectionFactory();
     $rows = array();
     foreach ($statement as $key => $row) {
         $row = $selectionFactory->createRow($row, $this->selection);
         $primary = $row->getSignature(false);
         $rows[$primary ?: $key] = $row;
     }
     return $rows;
 }
Exemplo n.º 2
0
 protected function getReference($table, $column)
 {
     if (array_key_exists($column, $this->data)) {
         $value = (string) $this->data[$column];
         $referenced = $this->selection->getReferencedTable($table, $column, $value);
         return isset($referenced[$value]) ? $referenced[$value] : NULL;
         // referenced row may not exist
     }
     return FALSE;
 }
Exemplo n.º 3
0
 public function delete()
 {
     $context = $this->context;
     $this->context = clone $context;
     $this->where($this->column, $this->active);
     $return = parent::delete();
     $this->context = $context;
     return $return;
 }