/** * @param School $school * @param string $activity * @return boolean true if the activity is enabled for the school */ protected function isActivityEnabled(School $school, $activity) { if ($activity == 'cantine' && $school->getActiveCantine()) { return true; } if ($activity == 'tap' && $school->getActiveTap()) { return true; } if ($activity == 'garderie_matin' && $school->getActiveGarderie()) { return true; } if ($activity == 'garderie_soir' && $school->getActiveGarderie()) { return true; } return false; }