本文整理匯總了PHP中Scheduler::setConfiguredId方法的典型用法代碼示例。如果您正苦於以下問題:PHP Scheduler::setConfiguredId方法的具體用法?PHP Scheduler::setConfiguredId怎麽用?PHP Scheduler::setConfiguredId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Scheduler
的用法示例。
在下文中一共展示了Scheduler::setConfiguredId方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getOrCreateScheduler
/**
* batch getOrCreateScheduler returns a scheduler by name, create it if doesnt exist
*
* @param KalturaScheduler $scheduler
* @return Scheduler
*/
private function getOrCreateScheduler(KalturaScheduler $scheduler)
{
$c = new Criteria();
$c->add(SchedulerPeer::CONFIGURED_ID, $scheduler->configuredId);
$schedulerDb = SchedulerPeer::doSelectOne($c, myDbHelper::getConnection(myDbHelper::DB_HELPER_CONN_PROPEL2));
if ($schedulerDb) {
if (strlen($schedulerDb->getHost()) && $schedulerDb->getHost() != $scheduler->host) {
throw new KalturaAPIException(KalturaErrors::SCHEDULER_HOST_CONFLICT, $scheduler->configuredId, $scheduler->host, $schedulerDb->getHost());
}
if ($schedulerDb->getName() != $scheduler->name || $schedulerDb->getHost() != $scheduler->host) {
$schedulerDb->setName($scheduler->name);
$schedulerDb->setHost($scheduler->host);
$schedulerDb->save();
}
return $schedulerDb;
}
$schedulerDb = new Scheduler();
$schedulerDb->setLastStatus(time());
$schedulerDb->setName($scheduler->name);
$schedulerDb->setHost($scheduler->host);
$schedulerDb->setConfiguredId($scheduler->configuredId);
$schedulerDb->setDescription('');
$schedulerDb->save();
return $schedulerDb;
}