public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     parent::setDefaultOptions($resolver);
     $resolver->setDefaults(array('query_builder' => function (EntityRepository $repository) {
         return $repository->createQueryBuilder('o')->orderBy('o.left', 'asc');
     }));
 }
 /**
  * {@inheritdoc}
  */
 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     parent::setDefaultOptions($resolver);
     $queryBuilder = function (Options $options) {
         $repositoryOptions = array('disabled' => $options['disabled']);
         return function (PaymentMethodRepositoryInterface $repository) use($repositoryOptions) {
             return $repository->getQueryBuidlerForChoiceType($repositoryOptions);
         };
     };
     $resolver->setDefaults(array('query_builder' => $queryBuilder, 'disabled' => false));
 }
示例#3
0
 /**
  * {@inheritdoc}
  */
 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     parent::setDefaultOptions($resolver);
     $resolver->setDefaults(array('property' => 'id'));
 }