public static function actionAddProject($data) { $project = Project::getEntity($data['id']); if ($project->getId() != null) { // Save skills $new_project = Project::fetchEntity($data); $skills = $new_project->getSkills(); if (count($skills) > 0) { foreach ($skills as $skill) { if ($skill->isActive == 1) { Skill::addSkillToProject($skill->id, $new_project->getId()); } else { Skill::deleteSkillForProject($skill->id, $new_project->getId()); } } } // Return to save the team member return true; } return false; }