PHP Класс Bolt\Storage\Field\Type\RelationType

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

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

Метод Описание
getName ( )
hydrate ( $data, $entity )
load ( Doctrine\DBAL\Query\QueryBuilder $query, Bolt\Storage\Mapping\ClassMetadata $metadata ) : void For relations, the load method adds an extra ->addSelect() and ->leftJoin() to the query that fetches the related records from the join table in the same query as the content fetch.
persist ( Bolt\Storage\QuerySet $queries, $entity )
query ( Bolt\Storage\Query\QueryInterface $query, Bolt\Storage\Mapping\ClassMetadata $metadata ) : void Relation fields can allow filters on the relations fetched. For now this is limited to the id field because of the possible complexity of fetching and filtering all the related data.

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

Метод Описание
getExistingRelations ( mixed $entity ) : array Get existing relationship records.
getInverseRelations ( mixed $entity ) : array Get inverse relationship records. That is ones where the definition happened on the opposite record
getPlatformGroupConcat ( string $column, string $alias, Doctrine\DBAL\Query\QueryBuilder $query ) : string Get platform specific group_concat token for provided column

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

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

Get existing relationship records.
protected getExistingRelations ( mixed $entity ) : array
$entity mixed
Результат array

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

Get inverse relationship records. That is ones where the definition happened on the opposite record
protected getInverseRelations ( mixed $entity ) : array
$entity mixed
Результат array

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

public getName ( )

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

Get platform specific group_concat token for provided column
protected getPlatformGroupConcat ( string $column, string $alias, Doctrine\DBAL\Query\QueryBuilder $query ) : string
$column string
$alias string
$query Doctrine\DBAL\Query\QueryBuilder
Результат string

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

public hydrate ( $data, $entity )

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

IDs are returned comma-separated which the ->hydrate() method can then turn into pointers to the related entities.
public load ( Doctrine\DBAL\Query\QueryBuilder $query, Bolt\Storage\Mapping\ClassMetadata $metadata ) : void
$query Doctrine\DBAL\Query\QueryBuilder
$metadata Bolt\Storage\Mapping\ClassMetadata
Результат void

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

public persist ( Bolt\Storage\QuerySet $queries, $entity )
$queries Bolt\Storage\QuerySet

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

For example the following queries: 'pages', {'relationkey'=>'1'} 'pages', {'relationkey'=>'1 || 2 || 3'}. Because the search is actually on the join table, we replace the expression to filter the join side rather than on the main side.
public query ( Bolt\Storage\Query\QueryInterface $query, Bolt\Storage\Mapping\ClassMetadata $metadata ) : void
$query Bolt\Storage\Query\QueryInterface
$metadata Bolt\Storage\Mapping\ClassMetadata
Результат void