PHP Class Bolt\Storage\Field\Type\RepeaterType

Author: Ross Riley ([email protected])
Inheritance: extends FieldTypeBase
Show file Open project: bolt/bolt

Public Methods

Method Description
getName ( )
getStorageType ( )
hydrate ( $data, $entity )
load ( Doctrine\DBAL\Query\QueryBuilder $query, Bolt\Storage\Mapping\ClassMetadata $metadata ) : void For repeating fields, the load method adds extra joins and selects to the query that fetches the related records from the field and field value tables in the same query as the content fetch.
normalize ( $entity ) Normalize step ensures that we have correctly hydrated objects at the collection and entity level.
persist ( Bolt\Storage\QuerySet $queries, $entity )
set ( object $entity, mixed $val ) The set method gets called directly by a new entity builder. For this field we never want to allow null values, rather we want an empty collection so this overrides the default and handles that.

Protected Methods

Method Description
addToDeleteQuery ( Bolt\Storage\QuerySet $queries, $changes ) Query to delete existing field values.
addToInsertQuery ( Bolt\Storage\QuerySet $queries, array $changes, $entity ) Query to insert new field values.
addToUpdateQuery ( Bolt\Storage\QuerySet $queries, array $changes, $entity ) Query to insert new field values.
getExistingFields ( mixed $entity ) : array Get existing fields for this record.
getFieldType ( $field ) : mixed
getFieldTypeName ( $field ) : mixed
getPlatformGroupConcat ( string $alias, Doctrine\DBAL\Query\QueryBuilder $query ) : string Get platform specific group_concat token for provided column

Method Details

addToDeleteQuery() protected method

Query to delete existing field values.
protected addToDeleteQuery ( Bolt\Storage\QuerySet $queries, $changes )
$queries Bolt\Storage\QuerySet
$changes

addToInsertQuery() protected method

Query to insert new field values.
protected addToInsertQuery ( Bolt\Storage\QuerySet $queries, array $changes, $entity )
$queries Bolt\Storage\QuerySet
$changes array
$entity

addToUpdateQuery() protected method

Query to insert new field values.
protected addToUpdateQuery ( Bolt\Storage\QuerySet $queries, array $changes, $entity )
$queries Bolt\Storage\QuerySet
$changes array
$entity

getExistingFields() protected method

Get existing fields for this record.
protected getExistingFields ( mixed $entity ) : array
$entity mixed
return array

getFieldType() protected method

protected getFieldType ( $field ) : mixed
$field
return mixed

getFieldTypeName() protected method

protected getFieldTypeName ( $field ) : mixed
$field
return mixed

getName() public method

public getName ( )

getPlatformGroupConcat() protected method

Get platform specific group_concat token for provided column
protected getPlatformGroupConcat ( string $alias, Doctrine\DBAL\Query\QueryBuilder $query ) : string
$alias string
$query Doctrine\DBAL\Query\QueryBuilder
return string

getStorageType() public method

public getStorageType ( )

hydrate() public method

public hydrate ( $data, $entity )

load() public method

For repeating fields, the load method adds extra joins and selects to the query that fetches the related records from the field and field value tables 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
return void

normalize() public method

Normalize step ensures that we have correctly hydrated objects at the collection and entity level.
public normalize ( $entity )
$entity

persist() public method

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

set() public method

The set method gets called directly by a new entity builder. For this field we never want to allow null values, rather we want an empty collection so this overrides the default and handles that.
public set ( object $entity, mixed $val )
$entity object
$val mixed