PHP Class Bolt\Storage\Field\Type\TaxonomyType

Author: Ross Riley ([email protected])
Inheritance: extends FieldTypeBase
Afficher le fichier Open project: bolt/bolt

Méthodes publiques

Méthode Description
getName ( )
hydrate ( $data, $entity )
load ( Doctrine\DBAL\Query\QueryBuilder $query, Bolt\Storage\Mapping\ClassMetadata $metadata ) : void For the taxonomy field the load event modifies the query to fetch taxonomies related to a content record from the join table.
persist ( Bolt\Storage\QuerySet $queries, $entity )
query ( Bolt\Storage\Query\QueryInterface $query, Bolt\Storage\Mapping\ClassMetadata $metadata ) : void Taxonomy fields allows queries on the parameters passed in.

Méthodes protégées

Méthode Description
getExistingTaxonomies ( mixed $entity ) : array Direct query to get existing taxonomy records.
getGroup ( Taxonomy $taxonomy )
getPlatformGroupConcat ( string $column, string $order, string $alias, Doctrine\DBAL\Query\QueryBuilder $query ) : string Get platform specific group_concat token for provided column.
getSortorder ( Taxonomy $taxonomy )

Method Details

getExistingTaxonomies() protected méthode

Direct query to get existing taxonomy records.
protected getExistingTaxonomies ( mixed $entity ) : array
$entity mixed
Résultat array

getGroup() protected méthode

protected getGroup ( Taxonomy $taxonomy )
$taxonomy Bolt\Storage\Collection\Taxonomy

getName() public méthode

public getName ( )

getPlatformGroupConcat() protected méthode

Get platform specific group_concat token for provided column.
protected getPlatformGroupConcat ( string $column, string $order, string $alias, Doctrine\DBAL\Query\QueryBuilder $query ) : string
$column string
$order string
$alias string
$query Doctrine\DBAL\Query\QueryBuilder
Résultat string

getSortorder() protected méthode

protected getSortorder ( Taxonomy $taxonomy )
$taxonomy Bolt\Storage\Collection\Taxonomy

hydrate() public méthode

public hydrate ( $data, $entity )

load() public méthode

It does this via an additional ->addSelect() and ->leftJoin() call on the QueryBuilder which includes then includes the taxonomies in the same query as the content fetch.
public load ( Doctrine\DBAL\Query\QueryBuilder $query, Bolt\Storage\Mapping\ClassMetadata $metadata ) : void
$query Doctrine\DBAL\Query\QueryBuilder
$metadata Bolt\Storage\Mapping\ClassMetadata
Résultat void

persist() public méthode

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

query() public méthode

For example the following queries: 'pages', {'categories'=>'news'} 'pages', {'categories'=>'news || events'}. 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
Résultat void