public function executeListStatus() { $c = new Criteria(); $c->add(JobPeer::CODE, 'pmb_menu/listStatus'); $job = JobPeer::doSelectOne($c); $cw = new Criteria(); $cw->add(JobInformationPeer::JOB_ID, $job->getId()); $job_information = JobInformationPeer::doSelectOne($cw); $public_information = PublicInformationPeer::retrieveByPk($job_information->getPublicInformationId()); $job_category = JobCategoryPeer::retrieveByPk($job_information->getJobCategoryId()); $this->job = $job; $this->job_information = $job_information; $this->job_category = $job_category; $this->public_information = $public_information; }
public function executeDelete() { $job_category = JobCategoryPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($job_category); $ref_error = 0; foreach ($job_category->getRefCountMethods() as $ref) { $method = "count" . $ref['affix']; $count = $job_category->{$method}(); if ($count > 0) { ++$ref_error; $this->getRequest()->setError('job_category/delete/' . sfInflector::camelize($ref['table']), $count); } } if ($ref_error > 0) { $this->getRequest()->setError('job_category/delete', '_ERR_DELETE_ (' . $job_category->toString() . ' - id:' . $job_category->getId() . ')'); } else { $job_category->delete(); } return $this->forward('job_category', 'list'); }