src/Form/DataTransformer/EntityCustomFieldTransformer.php
public function transform($collection)
    {
        if ($collection && !is_array($collection) && !($collection instanceof \ArrayAccess)) {
            // in case of single entity, we have to make sure it's managed
            if (!$this->er->getManager()->contains($collection)) {
                $collection = $this->er->getManager()->merge($collection);
            }
        }
        return $collection;
    }
public function transform($collection)
    {
        if ($collection && !is_array($collection) && !($collection instanceof \ArrayAccess)) {
            // in case of single entity, we have to make sure it's managed
            if (!$this->er->getManager()->contains($collection)) {
                $collection = $this->er->getManager()->merge($collection);
            }
        }
        return $collection;
    }
public function transform ( $ collection ) { if ( $ collection && ! is_array ( $ collection ) && ! ( $ collection instanceof \ ArrayAccess ) ) { // in case of single entity, we have to make sure it's managed if ( ! $ this -> er -> getManager ( ) -> contains ( $ collection ) ) { $ collection = $ this -> er -> getManager ( ) -> merge ( $ collection ) ; } } return $ collection ; }
No real transformation required in forward direction

@return mixed An array of entities

@throws TransformationFailedException
No real transformation required in forward direction