示例#1
0
 /**
  * {@inheritdoc}
  */
 public function create($name, $type = null, array $options = array())
 {
     if (null === $type && null === $this->getDataClass()) {
         $type = 'text';
     }
     if (null !== $type) {
         return $this->factory->createNamedBuilder($name, $type, null, $options, $this);
     }
     return $this->factory->createBuilderForProperty($this->getDataClass(), $name, null, $options, $this);
 }
示例#2
0
 /**
  * {@inheritdoc}
  */
 public function create($name, $type = null, array $options = array())
 {
     if ($this->locked) {
         throw new FormException('The form builder cannot be modified anymore.');
     }
     if (null === $type && null === $this->getDataClass()) {
         $type = 'text';
     }
     if (null !== $type) {
         return $this->factory->createNamedBuilder($name, $type, null, $options, $this);
     }
     return $this->factory->createBuilderForProperty($this->getDataClass(), $name, null, $options, $this);
 }
 /**
  * Wrapping the original form factory method
  * @param string $class
  * @param string $property
  * @param null $data
  * @param array $options
  * @author Martin Schindler
  * @return FormBuilderInterface
  */
 public function createBuilderForProperty($class, $property, $data = null, array $options = array())
 {
     return $this->formFactory->createBuilderForProperty($class, $property, $data, $options);
 }