public function transform($value)
    {
        if (null === $value || !($value instanceof Collection)) {
            return '';
        }

        $string = '';
        foreach ($value as $item) {
            $string .= $item->getId();

            if ($value->last() != $item) {
                $string .= ',';
            }
        }

        return $string;
    }
public function transform($value)
    {
        if (null === $value || !($value instanceof Collection)) {
            return '';
        }

        $string = '';
        foreach ($value as $item) {
            $string .= $item->getId();

            if ($value->last() != $item) {
                $string .= ',';
            }
        }

        return $string;
    }
public function transform ( $ value ) { if ( null === $ value || ! ( $ value instanceof Collection ) ) { return '' ; } $ string = '' ; foreach ( $ value as $ item ) { $ string .= $ item -> getId ( ) ; if ( $ value -> last ( ) != $ item ) { $ string .= ',' ; } } return $ string ; }
Transforms an ArrayCollection Object to a single Object.

@param \Doctrine\ORM\PersistentCollection $value

@return Object
Transforms an ArrayCollection Object to a single Object .