PHP Class Symfony\Bundle\DoctrineBundle\Form\ValueTransformer\CollectionToStringTransformer

Use-Cases for this transformer include: List of Tag-Names, List Of Group/User-Names or the like. This transformer only makes sense if you know the list of related collections to be small and that they have a unique identifier field that is of meaning to the user (Tag Names) and is enforced to be unique in the storage. This transformer can cause the following SQL operations to happen in the case of an ORM collection: 1. Initialize the whole collection using one SELECT query 2. For each removed element issue an UPDATE or DELETE stmt (depending on one-to-many or many-to-many) 3. For each inserted element issue an INSERT or UPDATE stmt (depending on one-to-many or many-to-many) 4. Extra updates if necessary by the ORM.
Author: Benjamin Eberlei ([email protected])
Inheritance: extends Symfony\Component\Form\ValueTransformer\BaseValueTransformer
Show file Open project: pmjones/php-framework-benchmarks

Public Methods

Method Description
reverseTransform ( string $value, Doctrine\Common\Collections\Collection $collection )
transform ( Doctrine\Common\Collections\Collection $value ) : string Transform a Doctrine Collection into a string of identifies with a separator.

Protected Methods

Method Description
configure ( )

Method Details

configure() protected method

protected configure ( )

reverseTransform() public method

public reverseTransform ( string $value, Doctrine\Common\Collections\Collection $collection )
$value string
$collection Doctrine\Common\Collections\Collection

transform() public method

Transform a Doctrine Collection into a string of identifies with a separator.
public transform ( Doctrine\Common\Collections\Collection $value ) : string
$value Doctrine\Common\Collections\Collection
return string