PHP Класс Spot\Relation\BelongsTo

Only used so that the query can be lazy-loaded on demand
Наследование: extends RelationAbstract, implements ArrayAccess
Показать файл Открыть проект

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

Метод Описание
__construct ( Mapper $mapper, $entityName, $foreignKey, $localKey, $identityValue ) Constructor function
__get ( $key ) ----------------------------------------------
__set ( $key, $val )
entity ( ) Helper function to return the entity
entityKey ( ) : string Get entity key field - for BelongsTo, this will be the local key instead of the primary key.
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

Защищенные методы

Метод Описание
buildQuery ( ) : Query Build query object

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

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

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

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

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

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

public __set ( $key, $val )

buildQuery() защищенный Метод

Build query object
protected buildQuery ( ) : Query
Результат Spot\Query

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

Helper function to return the entity
public entity ( )

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

Get entity key field - for BelongsTo, this will be the local key instead of the primary key.
public entityKey ( ) : string
Результат string

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

Find first entity in the set
public execute ( ) : Entity
Результат Spot\Entity

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

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

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

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

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

public offsetGet ( $key )

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

public offsetSet ( $key, $value )

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

public offsetUnset ( $key )

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

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
Результат boolean