本文整理汇总了PHP中entry::getSourceLink方法的典型用法代码示例。如果您正苦于以下问题:PHP entry::getSourceLink方法的具体用法?PHP entry::getSourceLink怎么用?PHP entry::getSourceLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类entry
的用法示例。
在下文中一共展示了entry::getSourceLink方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: entryCreated
/**
* @param entry $object
* @return bool true if should continue to the next consumer
*/
public function entryCreated(entry $object)
{
$mediaType = null;
if ($object->getType() == entryType::AUTOMATIC) {
KalturaLog::debug("entry id [" . $object->getId() . "] type [" . $object->getType() . "] source link [" . $object->getSourceLink() . "]");
$mediaType = $object->getMediaType();
if (isset(self::$fileExtensions[$mediaType])) {
$object->setType(entryType::DOCUMENT);
} elseif (is_null($mediaType) || $mediaType == entry::ENTRY_MEDIA_TYPE_ANY || $mediaType == entry::ENTRY_MEDIA_TYPE_AUTOMATIC) {
$this->setDocumentType($object);
}
}
if ($object->getType() != entryType::DOCUMENT) {
KalturaLog::debug("entry id [" . $object->getId() . "] type [" . $object->getType() . "]");
return true;
}
if (is_null($mediaType) || $mediaType == entry::ENTRY_MEDIA_TYPE_ANY || $mediaType == entry::ENTRY_MEDIA_TYPE_AUTOMATIC) {
$this->setDocumentType($object);
}
if ($object instanceof DocumentEntry) {
KalturaLog::debug("entry id [" . $object->getId() . "] already handled");
return true;
}
KalturaLog::debug("Handling object [" . get_class($object) . "] type [" . $object->getType() . "] id [" . $object->getId() . "] status [" . $object->getStatus() . "]");
if ($object->getConversionProfileId()) {
$object->setStatus(entryStatus::PRECONVERT);
$object->save();
}
return true;
}
示例2: setDocumentType
public function setDocumentType(entry $object)
{
$fileName = $object->getSourceLink();
$ext = strtolower(pathinfo($fileName, PATHINFO_EXTENSION));
foreach (self::$fileExtensions as $documentType => $extensions) {
if (in_array($ext, $extensions)) {
$object->setMediaType($documentType);
$object->setType(entryType::DOCUMENT);
break;
}
}
}
示例3: addEntryFromFlavorAsset
protected function addEntryFromFlavorAsset(KalturaBaseEntry $newEntry, entry $srcEntry, flavorAsset $srcFlavorAsset)
{
$newEntry->type = $srcEntry->getType();
if ($newEntry->name === null) {
$newEntry->name = $srcEntry->getName();
}
if ($newEntry->description === null) {
$newEntry->description = $srcEntry->getDescription();
}
if ($newEntry->creditUrl === null) {
$newEntry->creditUrl = $srcEntry->getSourceLink();
}
if ($newEntry->creditUserName === null) {
$newEntry->creditUserName = $srcEntry->getCredit();
}
if ($newEntry->tags === null) {
$newEntry->tags = $srcEntry->getTags();
}
$newEntry->sourceType = KalturaSourceType::SEARCH_PROVIDER;
$newEntry->searchProviderType = KalturaSearchProviderType::KALTURA;
$dbEntry = $this->prepareEntryForInsert($newEntry);
$dbEntry->setSourceId($srcEntry->getId());
$kshow = $this->createDummyKShow();
$kshowId = $kshow->getId();
$msg = null;
$flavorAsset = kFlowHelper::createOriginalFlavorAsset($this->getPartnerId(), $dbEntry->getId(), $msg);
if (!$flavorAsset) {
KalturaLog::err("Flavor asset not created for entry [" . $dbEntry->getId() . "] reason [{$msg}]");
if ($dbEntry->getStatus() == entryStatus::NO_CONTENT) {
$dbEntry->setStatus(entryStatus::ERROR_CONVERTING);
$dbEntry->save();
}
throw new KalturaAPIException(KalturaErrors::ORIGINAL_FLAVOR_ASSET_NOT_CREATED, $msg);
}
$srcSyncKey = $srcFlavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
$newSyncKey = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
kFileSyncUtils::createSyncFileLinkForKey($newSyncKey, $srcSyncKey);
kEventsManager::raiseEvent(new kObjectAddedEvent($flavorAsset));
myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_ENTRY_ADD, $dbEntry);
$newEntry->fromObject($dbEntry, $this->getResponseProfile());
return $newEntry;
}