Ejemplo n.º 1
0
 /**
  * Interal mechanism to add Skills to Reference
  * 
  * @param Reference $model
  * @param mixed $data
  */
 protected function doAddSkills(Reference $model, $data)
 {
     $errors = [];
     foreach ($data as $entry) {
         if (!isset($entry['id'])) {
             $errors[] = 'Missing id for Skill';
         } else {
             $related = SkillQuery::create()->findOneById($entry['id']);
             $model->addSkill($related);
         }
     }
     if (count($errors) > 0) {
         return new ErrorsException($errors);
     }
 }