/** * Returns specified row. * * @param mixed $key Row's primary key * @return HyperRow|NULL if there is no such row */ public function offsetGet($key) { $result = $this->selection->offsetGet($key); if ($result instanceof ActiveRow) { return $this->factory->createRow($result, $this->selection->getName()); } return $result; }
/** * Returns value of column / referenced row * * @param $key * @return mixed|HyperRow|HyperSelection */ public function &__get($key) { // Try to get method - getter if (ObjectMixin::has($this, $key)) { return ObjectMixin::get($this, $key); } // Otherwise get ActiveRow property $result = $this->activeRow->__get($key); if ($result instanceof ActiveRow) { $hyperrow = $this->factory->createRow($result, $result->getTable()->getName()); return $hyperrow; } return $result; }
/** * @param string $tableName * @return HyperSelection */ public function table($tableName) { $selection = $this->context->table($tableName); return $this->factory->createSelection($selection); }