Ver Mensaje Individual
  #3 (permalink)  
Antiguo 17/06/2014, 10:11
yonynet
 
Fecha de Ingreso: junio-2014
Ubicación: Riobamba
Mensajes: 24
Antigüedad: 9 años, 11 meses
Puntos: 0
Respuesta: Filtrar lista generada por una tabla padre

A continuación el la clase: ArticuloType:

Código PHP:

class ArticuloType extends AbstractType
{
        
/**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        
$builder
            
->add('nombre')
            ->
add('categoria',array(
                
'class'=> 'yonytestBundle:Categoria',
                
'query_builder'=> function(EntityRepository $er){
                return 
$er->createQueryBuilder('c')
                        ->
where('c.estado','Activo');
    }
    ));
        
    }
    
    
/**
     * @param OptionsResolverInterface $resolver
     */
    
public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        
$resolver->setDefaults(array(
            
'data_class' => 'yony\testBundle\Entity\Articulo'
        
));
    }

    
/**
     * @return string
     */
    
public function getName()
    {
        return 
'yony_testbundle_articulo';
    }

al ejecutar el formulario me sale el siguiente error:

Expected argument of type "string or Symfony\Component\Form\FormTypeInterface", "array" given

Última edición por yonynet; 17/06/2014 a las 10:23