PHP Interface Nextras\Orm\Collection\ICollection

Inheritance: extends IteratorAggregat\IteratorAggregate, extends Countabl\Countable
Afficher le fichier Open project: nextras/orm Interface Usage Examples

Méthodes publiques

Méthode Description
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.

Method Details

countStored() public méthode

Counts collection entities without fetching them from storage.
public countStored ( ) : integer
Résultat integer

fetch() public méthode

Fetches the first row.
public fetch ( ) : Nextras\Orm\Entity\IEntity | null
Résultat Nextras\Orm\Entity\IEntity | null

fetchAll() public méthode

Fetches all records.
public fetchAll ( ) : Nextras\Orm\Entity\IEntity[]
Résultat Nextras\Orm\Entity\IEntity[]

fetchPairs() public méthode

Fetches all records like $key => $value pairs.
public fetchPairs ( string $key = null, string $value = null ) : array
$key string associative key
$value string value
Résultat array

findBy() public méthode

Returns new instance of collection.
public findBy ( array $where ) : Nextras\Orm\Collection\ICollection
$where array
Résultat Nextras\Orm\Collection\ICollection

getBy() public méthode

Returns IEntity filtered by conditions.
public getBy ( array $where ) : Nextras\Orm\Entity\IEntity | null
$where array
Résultat Nextras\Orm\Entity\IEntity | null

getEntityCount() public méthode

public getEntityCount ( Nextras\Orm\Entity\IEntity $parent = null ) : integer
$parent Nextras\Orm\Entity\IEntity
Résultat integer

getEntityIterator() public méthode

public getEntityIterator ( Nextras\Orm\Entity\IEntity $parent = null ) : Traversable
$parent Nextras\Orm\Entity\IEntity
Résultat Traversable

getRelationshipMapper() public méthode

public getRelationshipMapper ( ) : Nextras\Orm\Mapper\IRelationshipMapper
Résultat Nextras\Orm\Mapper\IRelationshipMapper

limitBy() public méthode

Limits number of rows.
public limitBy ( integer $limit, integer $offset = null ) : Nextras\Orm\Collection\ICollection
$limit integer
$offset integer
Résultat Nextras\Orm\Collection\ICollection

orderBy() public méthode

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
Résultat Nextras\Orm\Collection\ICollection

resetOrderBy() public méthode

Resets collection ordering.
public resetOrderBy ( ) : Nextras\Orm\Collection\ICollection
Résultat Nextras\Orm\Collection\ICollection

setRelationshipMapping() public méthode

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
Résultat self