PHP Class Spot\Relation\HasMany

Inheritance: extends RelationAbstract, implements Countable, implements IteratorAggregate, implements ArrayAccess
ファイルを表示 Open project: vlucas/spot2

Public Methods

Method Description
__construct ( Mapper $mapper, $entityName, $foreignKey, $localKey, $identityValue ) Constructor function
count ( ) : integer SPL Countable function Called automatically when attribute is used in a 'count()' function call
eagerLoadOnCollection ( $relationName, Collection $collection ) : Spot\Collection Map relation results to original collection of entities
getIterator ( ) : Collection SPL IteratorAggregate function Called automatically when attribute is used in a 'foreach' loop
identityValuesFromCollection ( Collection $collection ) Set identity values from given collection
offsetExists ( $key ) ----------------------------------------------
offsetGet ( $key )
offsetSet ( $key, $value )
offsetUnset ( $key )
save ( Spot\EntityInterface $entity, string $relationName, array $options = [] ) : boolean Save related entities

Protected Methods

Method Description
buildQuery ( ) : Query Build query object

Method Details

__construct() public method

Constructor function
public __construct ( Mapper $mapper, $entityName, $foreignKey, $localKey, $identityValue )
$mapper Spot\Mapper

buildQuery() protected method

Build query object
protected buildQuery ( ) : Query
return Spot\Query

count() public method

SPL Countable function Called automatically when attribute is used in a 'count()' function call
public count ( ) : integer
return integer

eagerLoadOnCollection() public method

Map relation results to original collection of entities
public eagerLoadOnCollection ( $relationName, Collection $collection ) : Spot\Collection
$collection Spot\Entity\Collection
return Spot\Collection

getIterator() public method

SPL IteratorAggregate function Called automatically when attribute is used in a 'foreach' loop
public getIterator ( ) : Collection
return Spot\Entity\Collection

identityValuesFromCollection() public method

Set identity values from given collection
public identityValuesFromCollection ( Collection $collection )
$collection Spot\Entity\Collection

offsetExists() public method

----------------------------------------------
public offsetExists ( $key )

offsetGet() public method

public offsetGet ( $key )

offsetSet() public method

public offsetSet ( $key, $value )

offsetUnset() public method

public offsetUnset ( $key )

save() public method

Save related entities
public save ( Spot\EntityInterface $entity, string $relationName, array $options = [] ) : boolean
$entity Spot\EntityInterface Entity to save relation from
$relationName string Name of the relation to save
$options array Options to pass to the mappers
return boolean