Exemplo n.º 1
0
 /**
  * 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;
 }
Exemplo n.º 2
0
 /**
  * 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;
 }
Exemplo n.º 3
0
 /**
  * @param string $tableName
  * @return HyperSelection
  */
 public function table($tableName)
 {
     $selection = $this->context->table($tableName);
     return $this->factory->createSelection($selection);
 }