Exemplo n.º 1
0
 public function bind(array $taintedValues = null, array $taintedFiles = null)
 {
     // remove the embedded new form if the name field was not provided
     if (isset($taintedValues['new_option']['title']) && (!$this->getObject()->getMultilang() && is_null($taintedValues['new_option']['title']) || strlen($taintedValues['new_option']['title']) === 0) || isset($taintedValues['new_option']['et']['name']) && ($this->getObject()->getMultilang() && is_null($taintedValues['new_option']['et']['name']) || strlen($taintedValues['new_option']['et']['name']) === 0)) {
         unset($this->embeddedForms['new_option'], $taintedValues['new_option']);
         // pass the new form validations
         $this->validatorSchema['new_option'] = new sfValidatorPass();
     } else {
         $this->embeddedForms['new_option']->getObject()->setParameter($this->getObject());
     }
     //		$taintedValues['multilang'] = $taintedValues['multilang'] == 'on' ? 'off' : 'on';
     // call parent bind method
     parent::bind($taintedValues, $taintedFiles);
 }
 protected function setupInheritance()
 {
     parent::setupInheritance();
     $this->widgetSchema->setNameFormat('parameter_article[%s]');
 }