PHP Класс Bolt\Storage\Collection\Relations

Автор: Ross Riley ([email protected])
Наследование: extends Doctrine\Common\Collections\ArrayCollection
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$em

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

Метод Описание
__construct ( array $elements = [], EntityManager $em = null ) Relations constructor.
getField ( string $fieldName, boolean $biDirectional = false, string $contentTypeName = null, integer $contentTypeId = null ) : Relations Gets a specific relation type name from the overall collection
getOriginal ( Bolt\Storage\Entity\Relations $entity ) : mixed | null This loops over the existing collection to see if the properties in the incoming are already available on a saved record. To do this it checks the four key properties if there's a match it returns the original, otherwise it returns the new and adds the new one to the collection.
incoming ( Content $entity ) : mixed Identifies which relations are incoming to the given entity
offsetGet ( $offset ) Overrides the default to allow fetching a sub-selection.
setEntityManager ( EntityManager $em )
setFromDatabaseValues ( array $result )
setFromPost ( array $formValues, Content $entity )
update ( Relations $collection ) : array Runs a check on an incoming collection to make sure that duplicates are filtered out. Precedence is given to records that are already persisted, with any diff in incoming properties updated.

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

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

Relations constructor.
public __construct ( array $elements = [], EntityManager $em = null )
$elements array
$em Bolt\Storage\EntityManager

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

Gets a specific relation type name from the overall collection
public getField ( string $fieldName, boolean $biDirectional = false, string $contentTypeName = null, integer $contentTypeId = null ) : Relations
$fieldName string
$biDirectional boolean
$contentTypeName string
$contentTypeId integer
Результат Relations

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

This loops over the existing collection to see if the properties in the incoming are already available on a saved record. To do this it checks the four key properties if there's a match it returns the original, otherwise it returns the new and adds the new one to the collection.
public getOriginal ( Bolt\Storage\Entity\Relations $entity ) : mixed | null
$entity Bolt\Storage\Entity\Relations
Результат mixed | null

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

Identifies which relations are incoming to the given entity
public incoming ( Content $entity ) : mixed
$entity Bolt\Storage\Entity\Content
Результат mixed

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

public offsetGet ( $offset )

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

public setEntityManager ( EntityManager $em )
$em Bolt\Storage\EntityManager

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

public setFromDatabaseValues ( array $result )
$result array

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

public setFromPost ( array $formValues, Content $entity )
$formValues array
$entity Bolt\Storage\Entity\Content

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

Any records not in the incoming set are deleted from the collection and the deleted ones returned as an array.
public update ( Relations $collection ) : array
$collection Relations
Результат array

Описание свойств

$em защищенное свойство

protected $em