/** * Interal mechanism to add Children to Skill * * @param Skill $model * @param mixed $data */ protected function doAddChildren(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->addSkillRelatedByDependencyId($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }