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


PHP kPluginableEnumsManager::coreValues方法代码示例

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


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

示例1: getExpiredJobs

 public static function getExpiredJobs()
 {
     $jobTypes = kPluginableEnumsManager::coreValues('BatchJobType');
     $executionAttempts2jobTypes = array();
     // Map between max execution attempts and job types
     foreach ($jobTypes as $jobType) {
         $executionAttempts = BatchJobLockPeer::getMaxExecutionAttempts($jobType);
         if (array_key_exists($executionAttempts, $executionAttempts2jobTypes)) {
             $executionAttempts2jobTypes[$executionAttempts][] = $jobType;
         } else {
             $executionAttempts2jobTypes[$executionAttempts] = array($jobType);
         }
     }
     // create query
     $c = new Criteria();
     $c->add(BatchJobLockPeer::STATUS, BatchJob::BATCHJOB_STATUS_FATAL, Criteria::NOT_EQUAL);
     $c->add(BatchJobLockPeer::DC, kDataCenterMgr::getCurrentDcId());
     // each DC should clean its own jobs
     // Query for each job type
     $batchJobLocks = array();
     foreach ($executionAttempts2jobTypes as $execAttempts => $jobTypes) {
         $typedCrit = clone $c;
         $typedCrit->add(BatchJobLockPeer::EXECUTION_ATTEMPTS, $execAttempts, Criteria::GREATER_THAN);
         $typedCrit->add(BatchJobLockPeer::JOB_TYPE, $jobTypes, Criteria::IN);
         $typedJobs = BatchJobLockPeer::doSelect($typedCrit, myDbHelper::getConnection(myDbHelper::DB_HELPER_CONN_PROPEL2));
         foreach ($typedJobs as $typedJob) {
             $batchJobLocks[$typedJob->getId()] = $typedJob;
         }
     }
     // get matching batch jobs
     return BatchJobPeer::retrieveByPKs(array_keys($batchJobLocks));
 }
开发者ID:DBezemer,项目名称:server,代码行数:32,代码来源:kBatchExclusiveLock.class.php

示例2: getExpiredJobs

 public static function getExpiredJobs()
 {
     $jobTypes = kPluginableEnumsManager::coreValues('BatchJobType');
     $c = new Criteria();
     $c->add(BatchJobPeer::STATUS, BatchJob::BATCHJOB_STATUS_FATAL, Criteria::NOT_EQUAL);
     $c->add(BatchJobPeer::DC, kDataCenterMgr::getCurrentDcId());
     // each DC should clean its own jobs
     //		$c->add(BatchJobPeer::PROCESSOR_EXPIRATION, time(), Criteria::LESS_THAN);
     //		$c->add(BatchJobPeer::SCHEDULER_ID, 0, Criteria::GREATER_THAN);
     //		$c->add(BatchJobPeer::WORKER_ID, 0, Criteria::GREATER_THAN);
     $jobs = array();
     foreach ($jobTypes as $jobType) {
         $typedCrit = clone $c;
         $typedCrit->add(BatchJobPeer::EXECUTION_ATTEMPTS, BatchJobPeer::getMaxExecutionAttempts($jobType), Criteria::GREATER_THAN);
         $typedCrit->add(BatchJobPeer::JOB_TYPE, $jobType);
         $typedJobs = BatchJobPeer::doSelect($typedCrit, myDbHelper::getConnection(myDbHelper::DB_HELPER_CONN_PROPEL2));
         foreach ($typedJobs as $typedJob) {
             $jobs[] = $typedJob;
         }
     }
     return $jobs;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:22,代码来源:kBatchExclusiveLock.class.php


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