public function bind(array $taintedValues = null, array $taintedFiles = null) { for($i=1;$i<=10;$i++) { if(!isset($taintedValues["item_pos$i"])) { // Eliminar forms inútiles unset($this->embeddedForms["item_pos$i"],$this->validatorSchema["item_pos$i"]); unset($taintedValues['item_pos'.$i]); } else { if (!empty($taintedValues["item_pos$i"]['nombre'])) { if (!isset($this->embeddedForms['item_pos'.$i])) { // Nuevos Ficheros $fichero = new Ficheros(); $fichero->setNombre($taintedValues["item_pos$i"]['nombre']); $fichero->setFile($taintedValues["item_pos$i"]['file']); $fichero->setVersion($this->getObject()); $this->embedForm('item_pos'.$i, new FicherosForm($fichero)); } else { if ($this->embeddedForms['item_pos'.$i]->getObject() -> getDeleted()) { // $this->embeddedForms['item_pos'.$i]-> getObject() -> delete(); $this->getObject()->getFicheros(); unset($this->embeddedForms["item_pos$i"],$this->validatorSchema["item_pos$i"]); unset($taintedValues['item_pos'.$i]); } else { $this->embeddedForms['item_pos'.$i]->getObject()->setVersion($this->getObject()); } } } else { unset($this->embeddedForms["item_pos$i"],$this->validatorSchema["item_pos$i"]); unset($taintedValues['item_pos'.$i]); } } } return parent::bind($taintedValues,$taintedFiles); }
public function configure() { parent::configure(); // Unset automatic fields like 'created_at', 'updated_at', 'created_by', 'updated_by' $this->unsetAutoFields(); }