Esempio n. 1
0
 public function getParentName()
 {
     if ($this->getParent() != null && $this->getParent() != 0) {
         return CounselingSpecPeer::retrieveByPk($this->getParent())->getDescription();
     }
     return '-';
 }
Esempio n. 2
0
 public function executeDelete()
 {
     $counseling_spec = CounselingSpecPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($counseling_spec);
     $ref_error = 0;
     foreach ($counseling_spec->getRefCountMethods() as $ref) {
         $method = "count" . $ref['affix'];
         $count = $counseling_spec->{$method}();
         if ($count > 0) {
             ++$ref_error;
             $this->getRequest()->setError('counseling_spec/delete/' . sfInflector::camelize($ref['table']), $count);
         }
     }
     if ($ref_error > 0) {
         $this->getRequest()->setError('counseling_spec/delete', '_ERR_DELETE_ (' . $counseling_spec->toString() . ' - id:' . $counseling_spec->getId() . ')');
     } else {
         $counseling_spec->delete();
     }
     return $this->forward('counseling_spec', 'list');
 }