示例#1
0
 /**
  * Interal mechanism to add Composites to Skill
  * 
  * @param Skill $model
  * @param mixed $data
  */
 protected function doAddComposites(Skill $model, $data)
 {
     $errors = [];
     foreach ($data as $entry) {
         if (!isset($entry['id'])) {
             $errors[] = 'Missing id for Skill';
         } else {
             $related = SkillQuery::create()->findOneById($entry['id']);
             $model->addSkillRelatedByCompositeId($related);
         }
     }
     if (count($errors) > 0) {
         return new ErrorsException($errors);
     }
 }