本文整理汇总了PHP中Job::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP Job::getName方法的具体用法?PHP Job::getName怎么用?PHP Job::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Job
的用法示例。
在下文中一共展示了Job::getName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getJobData
/**
* @param Job $job
* @return array
*/
private function _getJobData($job)
{
$jobData = array();
$jobData['id'] = $job->id;
$jobData['name'] = $job->getName();
$jobData['url'] = $job->getUrl();
$jobData['elapsed'] = $job->getElapsedText();
$jobData['queue_name'] = $job->getQueue()->getName();
$jobData['queue_url'] = $job->getQueue()->getUrl();
return $jobData;
}
示例2: api_canceljob
public function api_canceljob()
{
/* @var $job Job */
$job = new Job($this->args('job_id'));
if (!$job->isHydrated()) {
throw new Exception("Job does not exist.");
}
if (!$job->getQueue()->isMine()) {
throw new Exception("This job is not in your queue.");
}
//TODO Figure out if this should be implemented
//if (!$job->canDelete($job))
// throw new Exception("You cannot delete this job.");
Activity::log("cancelled the <strong>" . $job->getName() . "</strong> job via the API.");
$job->cancelJob();
return $job->getAPIData();
}
示例3: testToStringReturnsTheNameOfTheJob
public function testToStringReturnsTheNameOfTheJob()
{
$jobMock = new Job('project', 'strategy', uniqid());
$this->assertEquals($jobMock->getName(), $jobMock->__toString());
}
示例4: edit
public function edit()
{
$this->assertLoggedIn();
try {
//how do we find them?
if ($this->args('id')) {
$job = new Job($this->args('id'));
}
//did we really get someone?
if (!$job->isHydrated()) {
throw new Exception("Could not find that job.");
}
if ($job->get('user_id') != User::$me->id) {
throw new Exception("You do not own this job.");
}
if ($job->get('status') != 'available') {
throw new Exception("You can only edit jobs that have not been taken yet.");
}
$this->setTitle('Edit Job - ' . $job->getName());
$this->set('job', $job);
//load up our queues.
$queues = User::$me->getQueues()->getAll();
foreach ($queues as $row) {
$q = $row['Queue'];
$data[$q->id] = $q->getName();
}
$this->set('queues', $data);
if ($this->args('submit')) {
$queue = new Queue($this->args('queue_id'));
if (!$queue->canAdd()) {
throw new Exception("That is not a valid queue.");
}
$job->set('queue_id', $queue->id);
$job->save();
Activity::log("edited the job " . $job->getLink() . ".");
$this->forwardToUrl($job->getUrl());
}
//errors?
if (!$this->get('megaerror')) {
$this->set('file', $job->getFile());
$this->set('queue', $job->getQueue());
$this->set('bot', $job->getBot());
$this->set('creator', $job->getUser());
}
} catch (Exception $e) {
$this->setTitle('Edit Job - Error');
$this->set('megaerror', $e->getMessage());
}
}
示例5: update
public function update(Job $job)
{
echo "Человек получил обновление о новой вакансии {$job->getName()} с зарплатой {$job->getSalary()} USD";
echo '<br>';
}