PHP Class Spot\Relation\HasOne

Inheritance: extends RelationAbstract
Mostrar archivo Open project: vlucas/spot2

Public Methods

Method Description
__construct ( Mapper $mapper, $entityName, $foreignKey, $localKey, $identityValue ) Constructor function
__get ( $key ) ----------------------------------------------
__set ( $key, $val )
entity ( ) Helper function to return the entity
execute ( ) : Entity Find first entity in the set
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

__get() public method

----------------------------------------------
public __get ( $key )

__set() public method

public __set ( $key, $val )

buildQuery() protected method

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

entity() public method

Helper function to return the entity
public entity ( )

execute() public method

Find first entity in the set
public execute ( ) : Entity
return Spot\Entity

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