Пример #1
0
 public function getParentRecurs($relate = array())
 {
     $relate[] = $this->getId();
     $parent = PayerTypePeer::retrieveByPk($this->getParent());
     if ($parent) {
         $relate = $parent->getParentRecurs($relate);
     }
     return $relate;
 }
Пример #2
0
 public function executeDelete()
 {
     $payer_type = PayerTypePeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($payer_type);
     $ref_error = 0;
     foreach ($payer_type->getRefCountMethods() as $ref) {
         $method = "count" . $ref['affix'];
         $count = $payer_type->{$method}();
         if ($count > 0) {
             ++$ref_error;
             $this->getRequest()->setError('payer_type/delete/' . sfInflector::camelize($ref['table']), $count);
         }
     }
     if ($ref_error > 0) {
         $this->getRequest()->setError('payer_type/delete', '_ERR_DELETE_ (' . $payer_type->getCode() . ' - id:' . $payer_type->getId() . ')');
     } else {
         $payer_type->delete();
     }
     return $this->forward('payer_type', 'list');
 }