Nette\Database\Table\Selection::offsetGet PHP Метод

offsetGet() публичный Метод

Returns specified row.
public offsetGet ( $key ) : Nette\Database\Table\IRow
Результат Nette\Database\Table\IRow or NULL if there is no such row
    public function offsetGet($key)
    {
        $this->execute();
        return $this->rows[$key];
    }

Usage Example

Пример #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;
 }