예제 #1
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     foreach ($this->privilegeConfig as $fieldName => $config) {
         $builder->add($fieldName, 'oro_acl_collection', array('type' => new AclPrivilegeType(), 'allow_add' => true, 'prototype' => false, 'allow_delete' => false, 'mapped' => false, 'options' => array('privileges_config' => $config)));
     }
     // Empty the privilege config to prevent parent from overriding the fields
     $this->privilegeConfig = array();
     parent::buildForm($builder, $options);
 }
 public function testSetDefaultOptions()
 {
     $resolver = $this->getMockBuilder('Symfony\\Component\\OptionsResolver\\OptionsResolverInterface')->disableOriginalConstructor()->getMock();
     $resolver->expects($this->once())->method('setDefaults')->with(array('data_class' => 'Oro\\Bundle\\UserBundle\\Entity\\Role', 'intention' => 'role'));
     $this->formType->configureOptions($resolver);
 }
예제 #3
0
 /**
  * {@inheritdoc}
  */
 public function configureOptions(OptionsResolver $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setDefaults(['csrf_protection' => false]);
 }
예제 #4
0
 /**
  * {@inheritdoc}
  */
 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     parent::setDefaultOptions($resolver);
     $resolver->setDefaults(['csrf_protection' => false]);
 }