Ejemplo n.º 1
0
 protected function processField($field)
 {
     switch ($field->getName()) {
         case 'ehriCopyrightIssue':
         case 'ehriScope':
         case 'ehriPriority':
             $name = $field->getName();
             $this->isad->{$name} = $this->form->getValue($name);
             break;
         case 'otherName':
             $value = $filtered = $this->form->getValue($field->getName());
             foreach ($this[$field->getName()] as $item) {
                 if (isset($value[$item->id])) {
                     $item->name = $value[$item->id];
                     unset($filtered[$item->id]);
                 } else {
                     $item->delete();
                 }
             }
             foreach ($filtered as $item) {
                 $otherName = new QubitOtherName();
                 $otherName->name = $item;
                 $otherName->typeId = QubitTerm::OTHER_FORM_OF_NAME_ID;
                 $this->resource->otherNames[] = $otherName;
             }
             break;
         default:
             return parent::processField($field);
     }
 }