/** * This action deletes a created SchoolYear registration for selected student * * @see executeRegisterForCurrentSchoolYear * @param sfWebRequest $request */ public function executeDeleteRegistrationForCurrentSchoolYear(sfWebRequest $request) { if ($request->isMethod("POST")) { $s = SchoolYearStudentPeer::retrieveByPK($request->getParameter('school_year_student_id')); if (!is_null($s)) { $s->delete(); $this->getUser()->setFlash('info', 'The item was deleted successfully.'); $this->redirect('@student'); } } $this->getUser()->setFlash('error', "The current school year student registration can't be deleted"); $this->redirect('@student'); }