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


PHP Job::getByID方法代码示例

本文整理汇总了PHP中Job::getByID方法的典型用法代码示例。如果您正苦于以下问题:PHP Job::getByID方法的具体用法?PHP Job::getByID怎么用?PHP Job::getByID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Job的用法示例。


在下文中一共展示了Job::getByID方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: uninstall

	function uninstall(){
		Loader::model("job");
		$jobObj=Job::getByID( intval($_REQUEST['jID']) ); 
		if( $jobObj && !$jobObj->jNotUninstallable ){
			$jobObj->uninstall();
		}		
		$this->redirect('/dashboard/system/jobs');
	}
开发者ID:rii-J,项目名称:concrete5-de,代码行数:8,代码来源:jobs.php

示例2: uninstall

 function uninstall($job_id = null)
 {
     if ($job_id) {
         Loader::model("job");
         $job = Job::getByID((int) $job_id);
         if ($job) {
             if (!$job->jNotUninstallable) {
                 $job->uninstall();
                 $this->set('message', t('Job succesfully uninstalled.'));
             } else {
                 $this->error->add(t('This job cannot be uninstalled.'));
             }
         } else {
             $this->error->add(t('Job not found.'));
         }
     } else {
         $this->error->add(t('No job specified.'));
     }
     $this->view();
 }
开发者ID:ricardomccerqueira,项目名称:rcerqueira.portfolio,代码行数:20,代码来源:jobs.php

示例3: exportList

 public static function exportList($xml)
 {
     $jl = self::getList();
     if ($jl->numRows() > 0) {
         $jx = $xml->addChild('jobs');
         while ($r = $jl->FetchRow()) {
             $j = Job::getByID($r['jID']);
             $ch = $jx->addChild('job');
             $ch->addAttribute('handle', $j->getJobHandle());
             $ch->addAttribute('package', $j->getPackageHandle());
         }
     }
 }
开发者ID:ronlobo,项目名称:concrete5-de,代码行数:13,代码来源:job.php

示例4: update_job_schedule

 public function update_job_schedule()
 {
     $jID = $this->post('jID');
     $J = Job::getByID($jID);
     $J->setSchedule($this->post('isScheduled'), $this->post('unit'), max(0, (int) $this->post('value')));
     $this->redirect('/dashboard/system/optimization/jobs', 'job_scheduled');
 }
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:7,代码来源:jobs.php

示例5: defined

<?php

defined('C5_EXECUTE') or die("Access Denied.");
if (!ini_get('safe_mode')) {
    @set_time_limit(0);
}
$json = Loader::helper('json');
if (Job::authenticateRequest($_REQUEST['auth'])) {
    if (strlen($_REQUEST['jHandle']) > 0 || intval($_REQUEST['jID']) > 0) {
        if ($_REQUEST['jHandle']) {
            $job = Job::getByHandle($_REQUEST['jHandle']);
        } else {
            $job = Job::getByID(intval($_REQUEST['jID']));
        }
    }
}
if (is_object($job)) {
    if ($job->supportsQueue()) {
        $q = $job->getQueueObject();
        if ($_POST['process']) {
            $obj = new stdClass();
            $js = Loader::helper('json');
            try {
                $messages = $q->receive($job->getJobQueueBatchSize());
                foreach ($messages as $key => $p) {
                    $job->processQueueItem($p);
                    $q->deleteMessage($p);
                }
                $totalItems = $q->count();
                $obj->totalItems = $totalItems;
                if ($q->count() == 0) {
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:31,代码来源:run_single.php

示例6: getList

	public static function getList($scheduledOnly = false){
		$db = Loader::db();
		
		if($scheduledOnly) {
			$q = "SELECT jID FROM Jobs WHERE isScheduled = 1 ORDER BY jDateLastRun";
		} else {
			$q = "SELECT jID FROM Jobs ORDER BY jDateLastRun";
		}
		$r = $db->Execute($q);
		$jobs = array();
		while ($row = $r->FetchRow()) {
			$j = Job::getByID($row['jID']);
			if (is_object($j)) {
				$jobs[] = $j;
			}
		}
		return $jobs;
	}
开发者ID:ronlobo,项目名称:concrete5,代码行数:18,代码来源:job.php

示例7: getJobs

 public function getJobs()
 {
     $db = Loader::db();
     $r = $db->Execute('select jID from JobSetJobs where jsID = ? order by jID asc', $this->getJobSetId());
     $jobs = array();
     while ($row = $r->FetchRow()) {
         $j = Job::getByID($row['jID']);
         if (is_object($j)) {
             $jobs[] = $j;
         }
     }
     return $jobs;
 }
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:13,代码来源:job_set.php

示例8: defined

<?php

defined('C5_EXECUTE') or die("Access Denied.");
if (!ini_get('safe_mode')) {
    @set_time_limit(0);
}
$json = Loader::helper('json');
$r = new stdClass();
$r->results = array();
if (Job::authenticateRequest($_REQUEST['auth'])) {
    // Legacy
    if ($_REQUEST['jID']) {
        $j = Job::getByID($_REQUEST['jID']);
        $obj = $j->executeJob();
        print $json->encode($obj);
        exit;
    }
    if ($_REQUEST['jHandle']) {
        $j = Job::getByHandle($_REQUEST['jHandle']);
        $obj = $j->executeJob();
        print $json->encode($obj);
        exit;
    }
    if ($_REQUEST['jsID']) {
        $js = JobSet::getByID($_REQUEST['jsID']);
    } else {
        // default set legacy support
        $js = JobSet::getDefault();
    }
    if (is_object($js)) {
        $jobs = $js->getJobs();
开发者ID:Zyqsempai,项目名称:amanet,代码行数:31,代码来源:jobs.php


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