当前位置: 首页>>代码示例>>PHP>>正文


PHP Job::getName方法代码示例

本文整理汇总了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;
 }
开发者ID:eric116,项目名称:BotQueue,代码行数:15,代码来源:main.php

示例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();
 }
开发者ID:eric116,项目名称:BotQueue,代码行数:17,代码来源:apiv1.php

示例3: testToStringReturnsTheNameOfTheJob

 public function testToStringReturnsTheNameOfTheJob()
 {
     $jobMock = new Job('project', 'strategy', uniqid());
     $this->assertEquals($jobMock->getName(), $jobMock->__toString());
 }
开发者ID:Chris7,项目名称:JoliCi,代码行数:5,代码来源:JobTest.php

示例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());
     }
 }
开发者ID:ricberw,项目名称:BotQueue,代码行数:49,代码来源:job.php

示例5: update

 public function update(Job $job)
 {
     echo "Человек получил обновление о новой вакансии {$job->getName()} с зарплатой {$job->getSalary()} USD";
     echo '<br>';
 }
开发者ID:maximing,项目名称:pattern-observer-php,代码行数:5,代码来源:Human.php


注:本文中的Job::getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。