PHP Class Tetranz\Select2EntityBundle\Form\DataTransformer\EntityToPropertyTransformer

Class EntityToPropertyTransformer
Inheritance: implements Symfony\Component\Form\DataTransformerInterface
Show file Open project: tetranz/select2entity-bundle

Protected Properties

Property Type Description
$className string
$em Doctrine\Common\Persistence\ObjectManager
$primaryKey string
$textProperty string

Public Methods

Method Description
__construct ( Doctrine\Common\Persistence\ObjectManager $em, string $class, string | null $textProperty = null, string $primaryKey = 'id' )
reverseTransform ( string $value ) : mixed | null | object Transform single id value to an entity
transform ( mixed $entity ) : array Transform entity to array

Method Details

__construct() public method

public __construct ( Doctrine\Common\Persistence\ObjectManager $em, string $class, string | null $textProperty = null, string $primaryKey = 'id' )
$em Doctrine\Common\Persistence\ObjectManager
$class string
$textProperty string | null
$primaryKey string

reverseTransform() public method

Transform single id value to an entity
public reverseTransform ( string $value ) : mixed | null | object
$value string
return mixed | null | object

transform() public method

Transform entity to array
public transform ( mixed $entity ) : array
$entity mixed
return array

Property Details

$className protected property

protected string $className
return string

$em protected property

protected ObjectManager,Doctrine\Common\Persistence $em
return Doctrine\Common\Persistence\ObjectManager

$primaryKey protected property

protected string $primaryKey
return string

$textProperty protected property

protected string $textProperty
return string