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