Exemplo n.º 1
0
 /**
  * Create distribution form
  *
  * @param string $type
  * @param SystemAccount $account
  * @param array $options
  * @return \Symfony\Component\Form\FormInterface
  * @throws \InvalidArgumentException
  */
 public function create($type, SystemAccount $account, array $options = array())
 {
     if (!array_key_exists($type, Distribution::getTypeChoices())) {
         throw new \InvalidArgumentException(sprintf('Invalid value for type argument: %s', $type));
     }
     $formType = $this->buildFormType($type, $account);
     $formData = $this->buildFormData($type, $account);
     return $this->factory->create($formType, $formData, $options);
 }