本文整理汇总了PHP中kJobsManager::addProvisionProvideJob方法的典型用法代码示例。如果您正苦于以下问题:PHP kJobsManager::addProvisionProvideJob方法的具体用法?PHP kJobsManager::addProvisionProvideJob怎么用?PHP kJobsManager::addProvisionProvideJob使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kJobsManager
的用法示例。
在下文中一共展示了kJobsManager::addProvisionProvideJob方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addAction
/**
* Adds new live stream entry.
* The entry will be queued for provision.
*
* @action add
* @param KalturaLiveStreamEntry $liveStreamEntry Live stream entry metadata
* @param KalturaSourceType $sourceType Live stream source type
* @return KalturaLiveStreamEntry The new live stream entry
*
* @throws KalturaErrors::PROPERTY_VALIDATION_CANNOT_BE_NULL
*/
function addAction(KalturaLiveStreamEntry $liveStreamEntry, $sourceType = null)
{
if ($sourceType) {
$liveStreamEntry->sourceType = $sourceType;
} elseif (is_null($liveStreamEntry->sourceType)) {
// default sourceType is AKAMAI_LIVE
$liveStreamEntry->sourceType = kPluginableEnumsManager::coreToApi('EntrySourceType', $this->getPartner()->getDefaultLiveStreamEntrySourceType());
}
$dbEntry = $this->prepareEntryForInsert($liveStreamEntry);
$dbEntry->save();
$te = new TrackEntry();
$te->setEntryId($dbEntry->getId());
$te->setTrackEventTypeId(TrackEntry::TRACK_ENTRY_EVENT_TYPE_ADD_ENTRY);
$te->setDescription(__METHOD__ . ":" . __LINE__ . "::" . $dbEntry->getSource());
TrackEntry::addTrackEntry($te);
//If a jobData can be created for entry sourceType, add provision job. Otherwise, just save the entry.
$jobData = kProvisionJobData::getInstance($dbEntry->getSource());
if ($jobData) {
/* @var $data kProvisionJobData */
$jobData->populateFromPartner($dbEntry->getPartner());
$jobData->populateFromEntry($dbEntry);
kJobsManager::addProvisionProvideJob(null, $dbEntry, $jobData);
} else {
$dbEntry->setStatus(entryStatus::READY);
$dbEntry->save();
$liveAssets = assetPeer::retrieveByEntryId($dbEntry->getId(), array(assetType::LIVE));
foreach ($liveAssets as $liveAsset) {
/* @var $liveAsset liveAsset */
$liveAsset->setStatus(asset::ASSET_STATUS_READY);
$liveAsset->save();
}
}
myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_ENTRY_ADD, $dbEntry, $this->getPartnerId(), null, null, null, $dbEntry->getId());
$liveStreamEntry->fromObject($dbEntry, $this->getResponseProfile());
return $liveStreamEntry;
}
示例2: insertLiveStreamEntry
private function insertLiveStreamEntry(KalturaLiveStreamAdminEntry $liveStreamEntry)
{
// first validate the input object
$liveStreamEntry->validatePropertyNotNull("mediaType");
$liveStreamEntry->validatePropertyNotNull("sourceType");
$liveStreamEntry->validatePropertyNotNull("encodingIP1");
$liveStreamEntry->validatePropertyNotNull("encodingIP2");
$liveStreamEntry->validatePropertyNotNull("streamPassword");
// create a default name if none was given
if (!$liveStreamEntry->name) {
$liveStreamEntry->name = $this->getPartnerId() . '_' . time();
}
// first copy all the properties to the db entry, then we'll check for security stuff
$dbEntry = $liveStreamEntry->toObject(new entry());
$this->checkAndSetValidUserInsert($liveStreamEntry, $dbEntry);
$this->checkAdminOnlyInsertProperties($liveStreamEntry);
$this->validateAccessControlId($liveStreamEntry);
$this->validateEntryScheduleDates($liveStreamEntry, $dbEntry);
$dbEntry->setPartnerId($this->getPartnerId());
$dbEntry->setSubpId($this->getPartnerId() * 100);
$dbEntry->setKuserId($this->getKuser()->getId());
$dbEntry->setCreatorKuserId($this->getKuser()->getId());
$dbEntry->setStatus(entryStatus::IMPORT);
$te = new TrackEntry();
$te->setEntryId($dbEntry->getId());
$te->setTrackEventTypeId(TrackEntry::TRACK_ENTRY_EVENT_TYPE_ADD_ENTRY);
$te->setDescription(__METHOD__ . ":" . __LINE__ . "::ENTRY_MEDIA_SOURCE_AKAMAI_LIVE");
TrackEntry::addTrackEntry($te);
//if type is manual don't create batch job, just change entry status to ready
if ($liveStreamEntry->sourceType == KalturaSourceType::MANUAL_LIVE_STREAM) {
$dbEntry->setStatus(entryStatus::READY);
$dbEntry->save();
} else {
$dbEntry->save();
kJobsManager::addProvisionProvideJob(null, $dbEntry);
}
return $dbEntry;
}