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; }
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; }
public function delete() { $context = $this->context; $this->context = clone $context; $this->where($this->column, $this->active); $return = parent::delete(); $this->context = $context; return $return; }