Beispiel #1
0
 public function executeDelete()
 {
     $academic_process = AcademicProcessPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($academic_process);
     $ref_error = 0;
     foreach ($academic_process->getRefCountMethods() as $ref) {
         $method = "count" . $ref['affix'];
         $count = $academic_process->{$method}();
         if ($count > 0) {
             ++$ref_error;
             $this->getRequest()->setError('academic_process/delete/' . sfInflector::camelize($ref['table']), $count);
         }
     }
     if ($ref_error > 0) {
         $this->getRequest()->setError('academic_process/delete', '_ERR_DELETE_ (' . $academic_process->toString() . ' - id:' . $academic_process->getId() . ')');
     } else {
         $academic_process->delete();
     }
     return $this->forward('academic_process', 'list');
 }