src/AppBundle/Form/DataTransformer/FacturaPagosDataTransformer.php
/**
     * Pasa entidades a un array
     *
     * @param Pago[] $pagos
     * @return mixed The value in the transformed representation
     * @throws TransformationFailedException when the transformation fails
     */
Pasa entidades a un array
@param Pago[] $pagos
@return mixed The value in the transformed representation
@throws TransformationFailedException when the transformation fails
Pasa entidades a un array @param Pago [] $pagos @return mixed The value in the transformed representation @throws TransformationFailedException when the transformation fails
public function transform($pagos)
    {
        if (is_null($pagos) || count($pagos) === 0) {
            return [];
        }
        $data = [];
        foreach ($pagos as $pago) {
            $data[] = '$' . number_format($pago->getCantidad() / 100, 2) . ' ' . $pago->getDivisa();
        }
        return $data;
    }
public function transform ( $ pagos ) { if ( is_null ( $ pagos ) || count ( $ pagos ) === 0 ) { return [ ] ; } $ data = [ ] ; foreach ( $ pagos as $ pago ) { $ data [ ] = '$' . number_format ( $ pago -> getCantidad ( ) / 100 , 2 ) . ' ' . $ pago -> getDivisa ( ) ; } return $ data ; }
Pasa entidades a un array
 @param Pago[] $pagos
 @return mixed The value in the transformed representation
 @throws TransformationFailedException when the transformation fails
Pasa entidades a un array @param Pago [] $pagos @return mixed The value in the transformed representation @throws TransformationFailedException when the transformation fails