PHP Интерфейс Nextras\Orm\Collection\ICollection

Наследование: extends IteratorAggregat\IteratorAggregate, extends Countabl\Countable
Показать файл Открыть проект Примеры использования интерфейса

Открытые методы

Метод Описание
countStored ( ) : integer Counts collection entities without fetching them from storage.
fetch ( ) : Nextras\Orm\Entity\IEntity | null Fetches the first row.
fetchAll ( ) : Nextras\Orm\Entity\IEntity[] Fetches all records.
fetchPairs ( string $key = null, string $value = null ) : array Fetches all records like $key => $value pairs.
findBy ( array $where ) : Nextras\Orm\Collection\ICollection Returns entity collection filtered by conditions.
getBy ( array $where ) : Nextras\Orm\Entity\IEntity | null Returns IEntity filtered by conditions.
getEntityCount ( Nextras\Orm\Entity\IEntity $parent = null ) : integer
getEntityIterator ( Nextras\Orm\Entity\IEntity $parent = null ) : Traversable
getRelationshipMapper ( ) : Nextras\Orm\Mapper\IRelationshipMapper
limitBy ( integer $limit, integer $offset = null ) : Nextras\Orm\Collection\ICollection Limits number of rows.
orderBy ( string | array $column, string $direction = self::ASC ) : Nextras\Orm\Collection\ICollection Selects columns to order by.
resetOrderBy ( ) : Nextras\Orm\Collection\ICollection Resets collection ordering.
setRelationshipMapping ( Nextras\Orm\Mapper\IRelationshipMapper $mapper = null, Nextras\Orm\Entity\IEntity $parent = null ) : self Sets relationship mapping over collection.

Описание методов

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

Counts collection entities without fetching them from storage.
public countStored ( ) : integer
Результат integer

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

Fetches the first row.
public fetch ( ) : Nextras\Orm\Entity\IEntity | null
Результат Nextras\Orm\Entity\IEntity | null

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

Fetches all records.
public fetchAll ( ) : Nextras\Orm\Entity\IEntity[]
Результат Nextras\Orm\Entity\IEntity[]

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

Fetches all records like $key => $value pairs.
public fetchPairs ( string $key = null, string $value = null ) : array
$key string associative key
$value string value
Результат array

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

Returns new instance of collection.
public findBy ( array $where ) : Nextras\Orm\Collection\ICollection
$where array
Результат Nextras\Orm\Collection\ICollection

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

Returns IEntity filtered by conditions.
public getBy ( array $where ) : Nextras\Orm\Entity\IEntity | null
$where array
Результат Nextras\Orm\Entity\IEntity | null

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

public getEntityCount ( Nextras\Orm\Entity\IEntity $parent = null ) : integer
$parent Nextras\Orm\Entity\IEntity
Результат integer

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

public getEntityIterator ( Nextras\Orm\Entity\IEntity $parent = null ) : Traversable
$parent Nextras\Orm\Entity\IEntity
Результат Traversable

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

public getRelationshipMapper ( ) : Nextras\Orm\Mapper\IRelationshipMapper
Результат Nextras\Orm\Mapper\IRelationshipMapper

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

Limits number of rows.
public limitBy ( integer $limit, integer $offset = null ) : Nextras\Orm\Collection\ICollection
$limit integer
$offset integer
Результат Nextras\Orm\Collection\ICollection

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

Returns new instance of collection.
public orderBy ( string | array $column, string $direction = self::ASC ) : Nextras\Orm\Collection\ICollection
$column string | array column name or array of column names
$direction string sorting direction self::ASC or self::DESC
Результат Nextras\Orm\Collection\ICollection

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

Resets collection ordering.
public resetOrderBy ( ) : Nextras\Orm\Collection\ICollection
Результат Nextras\Orm\Collection\ICollection

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

Sets relationship mapping over collection.
public setRelationshipMapping ( Nextras\Orm\Mapper\IRelationshipMapper $mapper = null, Nextras\Orm\Entity\IEntity $parent = null ) : self
$mapper Nextras\Orm\Mapper\IRelationshipMapper
$parent Nextras\Orm\Entity\IEntity
Результат self