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