public function executeDeleteCompetency() { $subject_grading_id = $this->getRequestParameter('subject_grading_id'); $subject_grading = SubjectGradingPeer::retrieveByPK($subject_grading_id); $this->forward404Unless($subject_grading); $this->subject_grading = $subject_grading; $subject_competency = SubjectCompetencyPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($subject_competency); $ref_error = 0; foreach ($subject_competency->getRefCountMethods() as $ref) { $method = "count" . $ref['affix']; $count = $subject_competency->{$method}(); if ($count > 0) { ++$ref_error; $this->getRequest()->setError('subject_grading/deleteCompetency/' . sfInflector::camelize($ref['table']), $count); } } if ($ref_error > 0) { $this->getRequest()->setError('subject_grading/deleteCompetency', '_ERR_DELETE_ (' . $subject_competency->toString() . ' - id:' . $subject_competency->getId() . ')'); } else { $subject_competency->delete(); } $this->getRequest()->setParameter('subject_grading_id', $subject_grading_id); return $this->forward('subject_grading', 'listCompetency'); }
public function getSubjectGrading($con = null) { include_once 'lib/model/om/BaseSubjectGradingPeer.php'; if ($this->aSubjectGrading === null && $this->subject_grading_id !== null) { $this->aSubjectGrading = SubjectGradingPeer::retrieveByPK($this->subject_grading_id, $con); } return $this->aSubjectGrading; }
public function executeGetScores() { $subject_accal_id = $this->getRequestParameter('subject_accal_id'); $this->forward404Unless($subject_accal_id); $class_group_id = $this->getRequestParameter('class_group_id'); $this->forward404Unless($class_group_id); $subject_grading_id = $this->getRequestParameter('subject_grading_id'); // $this->forward404Unless($subject_grading_id); $c = new Criteria(); $c->add(VSubjectAccalLectorStudentDetailPeer::SUBJECT_ACCAL_ID, $subject_accal_id); $c->add(VSubjectAccalLectorStudentDetailPeer::CLASS_GROUP_ID, $class_group_id); $data = VSubjectAccalLectorStudentDetailPeer::doSelect($c); $this->data = $data; $this->subject_grading_id = $subject_grading_id; $this->class_group_id = $class_group_id; $this->subject_accal_id = $subject_accal_id; $this->subject_grading = SubjectGradingPeer::retrieveByPK($subject_grading_id); }