Nette\Database\Table\ActiveRow::ref PHP Метод

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

Returns referenced row.
public ref ( $key, $throughColumn = NULL ) : Nette\Database\Table\IRow
Результат Nette\Database\Table\IRow or NULL if the row does not exist
    public function ref($key, $throughColumn = NULL)
    {
        $row = $this->table->getReferencedTable($this, $key, $throughColumn);
        if ($row === FALSE) {
            throw new Nette\MemberAccessException("No reference found for \${$this->table->getName()}->ref({$key}).");
        }
        return $row;
    }

Usage Example

Пример #1
0
 /**
  * @param \Nette\Database\Table\ActiveRow
  * @return \Nette\Security\Identity
  */
 public function createIdentity(ActiveRow $user)
 {
     $data = $user->toArray();
     unset($data['password']);
     $role = strtolower($user->ref('users_groups', 'group_id')->g_title);
     return new Identity($user->id, $role, $data);
 }
All Usage Examples Of Nette\Database\Table\ActiveRow::ref