src/AppBundle/Form/DataTransformer/FacturaPagosDataTransformer.php
/**
     * Pasa un array de entidades a una coleccion
     *
     * @param mixed $values
     * @return mixed The value in the original representation
     * @throws TransformationFailedException when the transformation fails
     */
Pasa un array de entidades a una coleccion
@param mixed $values
@return mixed The value in the original representation
@throws TransformationFailedException when the transformation fails
Pasa un array de entidades a una coleccion @param mixed $values @return mixed The value in the original representation @throws TransformationFailedException when the transformation fails
public function reverseTransform($values)
    {
        if (!is_array($values) || count($values) === 0) {
            return [];
        }
        $qb = $this->em->getRepository('AppBundle:Pago')->createQueryBuilder('p');
        $pagos = $qb->where('p.id IN (:ids)')
            ->setParameter('ids', $values)
            ->getQuery()
            ->getResult();
        $entities = new ArrayCollection($pagos);
        if ($entities->isEmpty()) {
            throw new TransformationFailedException('No se encontraron los pagos');
        }
        return $entities;
    }
public function reverseTransform ( $ values ) { if ( ! is_array ( $ values ) || count ( $ values ) === 0 ) { return [ ] ; } $ qb = $ this -> em -> getRepository ( 'AppBundle:Pago' ) -> createQueryBuilder ( 'p' ) ; $ pagos = $ qb -> where ( 'p.id IN (:ids)' ) -> setParameter ( 'ids' , $ values ) -> getQuery ( ) -> getResult ( ) ; $ entities = new ArrayCollection ( $ pagos ) ; if ( $ entities -> isEmpty ( ) ) { throw new TransformationFailedException ( 'No se encontraron los pagos' ) ; } return $ entities ; }
Pasa un array de entidades a una coleccion
 @param mixed $values
 @return mixed The value in the original representation
 @throws TransformationFailedException when the transformation fails
Pasa un array de entidades a una coleccion @param mixed $values @return mixed The value in the original representation @throws TransformationFailedException when the transformation fails