本文整理汇总了PHP中JobPeer::retrieveByPk方法的典型用法代码示例。如果您正苦于以下问题:PHP JobPeer::retrieveByPk方法的具体用法?PHP JobPeer::retrieveByPk怎么用?PHP JobPeer::retrieveByPk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JobPeer
的用法示例。
在下文中一共展示了JobPeer::retrieveByPk方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeDelete
public function executeDelete()
{
$job = JobPeer::retrieveByPk($this->getRequestParameter('id'));
$this->forward404Unless($job);
$job_information = JobInformationPeer::retrieveByPk($this->getRequestParameter('job_information_id'));
$this->forward404Unless($job_information);
$ref_error = 0;
foreach ($job->getRefCountMethods() as $ref) {
$method = "count" . $ref['affix'];
$count = $job->{$method}();
if ($count > 0) {
++$ref_error;
$this->getRequest()->setError('job/delete/' . sfInflector::camelize($ref['table']), $count);
}
}
if ($ref_error > 0) {
$this->getRequest()->setError('job/delete', '_ERR_DELETE_ (' . $job->toString() . ' - id:' . $job->getId() . ')');
} else {
$job->delete();
$job_information->delete();
}
return $this->forward('job_information', 'list');
}
示例2: executeDelete
public function executeDelete()
{
$group = $this->getContext()->getUser()->getAttribute('group', null, 'bo');
if ($group != 'root') {
$this->forward('default', 'index');
}
$job = JobPeer::retrieveByPk($this->getRequestParameter('id'));
$this->forward404Unless($job);
$ref_error = 0;
foreach ($job->getRefCountMethods() as $ref) {
$method = "count" . $ref['affix'];
$count = $job->{$method}();
if ($count > 0) {
++$ref_error;
$this->getRequest()->setError('job/delete/' . sfInflector::camelize($ref['table']), $count);
}
}
if ($ref_error > 0) {
$this->getRequest()->setError('job/delete', '_ERR_DELETE_ (' . $job->toString() . ' - id:' . $job->getId() . ')');
} else {
$job->delete();
}
return $this->forward('job', 'list');
}