PHP Class YetORM\EntityCollection

Inheritance: extends Nette\Object, implements Iterator, implements Countable
ファイルを表示 Open project: uestla/yetorm Class Usage Examples

Protected Properties

Property Type Description
$data Entity[]
$entity string | Nette\Utils\Callback
$refColumn string | null
$refTable string | null
$selection Nette\Database\Table\Selection

Public Methods

Method Description
__construct ( Selection $selection, string | callable $entity, string $refTable = NULL, string $refColumn = NULL )
count ( string $column = NULL ) : integer
current ( ) : Entity
key ( ) : mixed
limit ( integer $limit, integer $offset = NULL ) : EntityCollection
next ( ) : void
orderBy ( string | array $column, boolean $dir = NULL ) : EntityCollection API:
rewind ( ) : void
toArray ( ) : array
valid ( ) : boolean

Private Methods

Method Description
invalidate ( ) : void
loadData ( ) : void

Method Details

__construct() public method

public __construct ( Selection $selection, string | callable $entity, string $refTable = NULL, string $refColumn = NULL )
$selection Nette\Database\Table\Selection
$entity string | callable
$refTable string
$refColumn string

count() public method

public count ( string $column = NULL ) : integer
$column string
return integer

current() public method

public current ( ) : Entity
return Entity

key() public method

public key ( ) : mixed
return mixed

limit() public method

public limit ( integer $limit, integer $offset = NULL ) : EntityCollection
$limit integer
$offset integer
return EntityCollection

next() public method

public next ( ) : void
return void

orderBy() public method

$this->orderBy('column', EntityCollection::DESC); // ORDER BY [column] DESC or $this->orderBy(array( 'first' => EntityCollection::ASC, 'second' => EntityCollection::DESC, ); // ORDER BY [first], [second] DESC
public orderBy ( string | array $column, boolean $dir = NULL ) : EntityCollection
$column string | array
$dir boolean
return EntityCollection

rewind() public method

public rewind ( ) : void
return void

toArray() public method

public toArray ( ) : array
return array

valid() public method

public valid ( ) : boolean
return boolean

Property Details

$data protected_oe property

protected Entity[],yetorm $data
return Entity[]

$entity protected_oe property

protected string|Callback,Nette\Utils $entity
return string | Nette\Utils\Callback

$refColumn protected_oe property

protected string|NULL $refColumn
return string | null

$refTable protected_oe property

protected string|NULL $refTable
return string | null

$selection protected_oe property

protected Selection,Nette\Database\Table $selection
return Nette\Database\Table\Selection