本文整理汇总了PHP中entryPeer::retrieveByPK方法的典型用法代码示例。如果您正苦于以下问题:PHP entryPeer::retrieveByPK方法的具体用法?PHP entryPeer::retrieveByPK怎么用?PHP entryPeer::retrieveByPK使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类entryPeer
的用法示例。
在下文中一共展示了entryPeer::retrieveByPK方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
/**
* Will anipulate a single entry
*/
public function execute()
{
$this->forceSystemAuthentication();
myDbHelper::$use_alternative_con = null;
$command = $this->getP("command");
if ($command == "updateEntry") {
$id = $this->getP("id");
$entry = entryPeer::retrieveByPK($id);
if ($entry) {
$name = $this->getP("name");
$value = $this->getP("value");
$obj_wrapper = objectWrapperBase::getWrapperClass($entry, 0);
$updateable_fields = $obj_wrapper->getUpdateableFields("2");
if (!in_array($name, $updateable_fields)) {
die;
}
if ($name) {
$setter = "set" . $name;
call_user_func(array($entry, $setter), $value);
$entry->save();
}
}
}
die;
}
示例2: postUpdate
public function postUpdate(PropelPDO $con = null)
{
parent::postUpdate($con);
categoryPeer::setUseCriteriaFilter(false);
$category = categoryPeer::retrieveByPK($this->getCategoryId());
categoryPeer::setUseCriteriaFilter(true);
if (!$category) {
throw new kCoreException('category id [' . $this->getCategoryId() . 'was not found', kCoreException::ID_NOT_FOUND);
}
$entry = entryPeer::retrieveByPK($this->getEntryId());
if (!$entry && $this->getStatus() != CategoryEntryStatus::DELETED) {
throw new kCoreException('entry id [' . $this->getEntryId() . 'was not found', kCoreException::ID_NOT_FOUND);
}
if ($entry && $this->getStatus() == CategoryEntryStatus::ACTIVE && $this->getColumnsOldValue(categoryEntryPeer::STATUS) == CategoryEntryStatus::PENDING) {
$entry = $this->setEntryOnCategory($category, $entry);
}
if ($this->getStatus() == CategoryEntryStatus::REJECTED && $this->getColumnsOldValue(categoryEntryPeer::STATUS) == CategoryEntryStatus::PENDING) {
$category->decrementPendingEntriesCount();
}
if ($this->getStatus() == CategoryEntryStatus::PENDING && $this->getColumnsOldValue(categoryEntryPeer::STATUS) == CategoryEntryStatus::REJECTED) {
$category->incrementPendingEntriesCount();
}
if ($this->getStatus() == CategoryEntryStatus::DELETED) {
if ($this->getColumnsOldValue(categoryEntryPeer::STATUS) == CategoryEntryStatus::ACTIVE) {
$category->decrementEntriesCount($this->getEntryId());
$category->decrementDirectEntriesCount($this->getEntryId());
if ($entry && !categoryEntryPeer::getSkipSave()) {
$categories = array();
if (trim($entry->getCategories()) != '') {
$categories = explode(entry::ENTRY_CATEGORY_SEPARATOR, $entry->getCategories());
foreach ($categories as $index => $entryCategoryFullName) {
if ($entryCategoryFullName == $category->getFullName()) {
unset($categories[$index]);
}
}
}
$categoriesIds = array();
if (trim($entry->getCategoriesIds()) != '') {
$categoriesIds = explode(entry::ENTRY_CATEGORY_SEPARATOR, $entry->getCategoriesIds());
foreach ($categories as $index => $entryCategoryId) {
if ($entryCategoryId == $category->getId()) {
unset($categoriesIds[$index]);
}
}
}
$entry->setCategories(implode(entry::ENTRY_CATEGORY_SEPARATOR, $categories));
$entry->setCategoriesIds(implode(entry::ENTRY_CATEGORY_SEPARATOR, $categoriesIds));
$entry->save();
}
kEventsManager::raiseEvent(new kObjectDeletedEvent($this));
}
if ($this->getColumnsOldValue(categoryEntryPeer::STATUS) == CategoryEntryStatus::PENDING) {
$category->decrementPendingEntriesCount();
}
}
$category->save();
if ($entry && !categoryEntryPeer::getSkipSave()) {
$entry->indexToSearchIndex();
}
}
示例3: getLocalThumbFilePath
public function getLocalThumbFilePath($version, $width, $height, $type, $bgcolor = "ffffff", $crop_provider = null, $quality = 0, $src_x = 0, $src_y = 0, $src_w = 0, $src_h = 0, $vid_sec = -1, $vid_slice = 0, $vid_slices = -1, $density = 0, $stripProfiles = false, $flavorId = null, $fileName = null)
{
if ($this->getStatus() == entryStatus::DELETED || $this->getModerationStatus() == moderation::MODERATION_STATUS_BLOCK) {
KalturaLog::log("rejected live stream entry - not serving thumbnail");
KExternalErrors::dieError(KExternalErrors::ENTRY_DELETED_MODERATED);
}
$contentPath = myContentStorage::getFSContentRootPath();
$liveEntryExist = false;
$liveThumbEntry = null;
$liveThumbEntryId = null;
$partner = $this->getPartner();
if ($partner) {
$liveThumbEntryId = $partner->getLiveThumbEntryId();
}
if ($liveThumbEntryId) {
$liveThumbEntry = entryPeer::retrieveByPK($liveThumbEntryId);
}
if ($liveThumbEntry && $liveThumbEntry->getMediaType() == entry::ENTRY_MEDIA_TYPE_IMAGE) {
$fileSyncVersion = $partner->getLiveThumbEntryVersion();
$liveEntryKey = $liveThumbEntry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_DATA, $fileSyncVersion);
$contentPath = kFileSyncUtils::getLocalFilePathForKey($liveEntryKey);
if ($contentPath) {
$msgPath = $contentPath;
$liveEntryExist = true;
} else {
KalturaLog::err('no local file sync for audio entry id');
}
}
if (!$liveEntryExist) {
$msgPath = $contentPath . "content/templates/entry/thumbnail/live_thumb.jpg";
}
return myEntryUtils::resizeEntryImage($this, $version, $width, $height, $type, $bgcolor, $crop_provider, $quality, $src_x, $src_y, $src_w, $src_h, $vid_sec, $vid_slice, $vid_slices, $msgPath, $density, $stripProfiles);
}
示例4: __construct
public function __construct(KalturaDistributionJobData $distributionJobData = null)
{
parent::__construct($distributionJobData);
if (!$distributionJobData) {
return;
}
if (!$distributionJobData->distributionProfile instanceof KalturaDailymotionDistributionProfile) {
return;
}
$flavorAssets = assetPeer::retrieveByIds(explode(',', $distributionJobData->entryDistribution->flavorAssetIds));
if (count($flavorAssets)) {
// if we have specific flavor assets for this distribution, grab the first one
$flavorAsset = reset($flavorAssets);
} else {
// take the source asset
$flavorAsset = assetPeer::retrieveOriginalReadyByEntryId($distributionJobData->entryDistribution->entryId);
}
if ($flavorAsset) {
$syncKey = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
$this->videoAssetFilePath = kFileSyncUtils::getLocalFilePathForKey($syncKey, false);
}
// look for krule with action block and condition of country
$entry = entryPeer::retrieveByPK($distributionJobData->entryDistribution->entryId);
if ($entry && $entry->getAccessControl()) {
$this->setGeoBlocking($entry->getAccessControl());
}
$this->addCaptionsData($distributionJobData);
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:28,代码来源:KalturaDailymotionDistributionJobProviderData.php
示例5: getEntry
/**
* @return entry
*/
public function getEntry()
{
if (!$this->aEntry && $this->getEntryId()) {
$this->aEntry = entryPeer::retrieveByPK($this->getEntryId());
}
return $this->aEntry;
}
示例6: createQuestionPdf
public function createQuestionPdf()
{
$dbEntry = entryPeer::retrieveByPK($this->entryId);
$title = "Here are the questions from [" . $dbEntry->getName() . "]";
KalturaLog::debug("Questions from [" . $dbEntry->getName() . "]");
$this->pdf->addTitle($title, $this->titleStyle);
$questionType = QuizPlugin::getCuePointTypeCoreValue(QuizCuePointType::QUIZ_QUESTION);
$questions = CuePointPeer::retrieveByEntryId($this->entryId, array($questionType));
//arange the array so that the questions will be the key for the array
$questArray = array();
foreach ($questions as $question) {
$questArray[$question->getName()] = $question;
}
//sort the array alphabetically according to its key; i.e. the question
ksort($questArray, SORT_LOCALE_STRING);
$questNum = 0;
foreach ($questArray as $question) {
$questNum += 1;
$this->pdf->addList($questNum, $question->getName(), $this->listWithAddLineBeforeStyle);
$this->pdf->addHeadline(6, "Optional Answers:", $this->heading6Style);
$ansNum = 0;
foreach ($question->getOptionalAnswers() as $optionalAnswer) {
$ansNum += 1;
$this->pdf->addList($ansNum, $optionalAnswer->getText(), $this->indentListStyle);
}
}
}
示例7: getUrlManagerByCdn
/**
* @param string $cdnHost
* @param string $entryId
* @return kUrlManager
*/
public static function getUrlManagerByCdn($cdnHost, $entryId)
{
$class = 'kUrlManager';
$cdnHost = preg_replace('/https?:\\/\\//', '', $cdnHost);
$cdnHost = preg_replace('/:\\d+$/', '', $cdnHost);
$params = null;
$urlManagers = kConf::getMap('url_managers');
if (isset($urlManagers[$cdnHost])) {
$class = $urlManagers[$cdnHost]["class"];
$params = @$urlManagers[$cdnHost]["params"];
$entry = entryPeer::retrieveByPK($entryId);
$urlManagersMap = kConf::getMap('url_managers');
if ($entry && isset($urlManagersMap["override"])) {
$overrides = $urlManagersMap["override"];
$partnerId = $entry->getPartnerId();
if (array_key_exists($partnerId, $overrides)) {
$overrides = $overrides[$partnerId];
foreach ($overrides as $override) {
if ($override['domain'] == $cdnHost) {
$params = array_merge($params, $override["params"]);
}
}
}
}
}
KalturaLog::log("Uses url manager [{$class}]");
return new $class(null, $params, $entryId);
}
示例8: applyFilterFields
protected function applyFilterFields(baseObjectFilter $filter)
{
/* @var $filter cuePointFilter */
// Reduce the cache expiry when fetching live stream cuepoints
$entryId = $filter->get('_in_entry_id');
if ($entryId && strpos($entryId, ',') === false) {
$entry = entryPeer::retrieveByPK($entryId);
if ($entry && $entry->getType() == entryType::LIVE_STREAM) {
kApiCache::setExpiry(self::LIVE_ENTRY_CUE_POINT_CACHE_EXPIRY_SECONDS);
}
}
if ($filter->get('_free_text')) {
$this->sphinxSkipped = false;
$freeTexts = $filter->get('_free_text');
KalturaLog::debug("Attach free text [{$freeTexts}]");
$this->addFreeTextToMatchClauseByMatchFields($freeTexts, CuePointFilter::FREE_TEXT_FIELDS);
}
$filter->unsetByName('_free_text');
if ($filter->get('_eq_is_public')) {
$this->sphinxSkipped = false;
$isPublic = $filter->get('_eq_is_public');
$this->addCondition('is_public' . " = " . $isPublic);
}
$filter->unsetByName('_eq_is_public');
return parent::applyFilterFields($filter);
}
示例9: getObject
public function getObject()
{
if ($this->m_object) {
return $this->m_object;
}
$object_id = $this->object_id;
if ($object_id == null) {
return null;
}
switch ($this->getObjectType()) {
case self::MODERATION_OBJECT_TYPE_KSHOW:
$this->m_object = kshowPeer::retrieveByPK($object_id);
break;
case self::MODERATION_OBJECT_TYPE_ENTRY:
// be able to fetch entries that are deleted
entryPeer::allowDeletedInCriteriaFilter();
$this->m_object = entryPeer::retrieveByPK($object_id);
entryPeer::blockDeletedInCriteriaFilter();
break;
case self::MODERATION_OBJECT_TYPE_USER:
// $object_id is the puser_id
$puser_kuser = PuserKuserPeer::retrieveByPartnerAndUid($this->getPartnerId(), NULL, $object_id, true);
if ($puser_kuser && $puser_kuser->getKuser()) {
$this->m_object = $puser_kuser->getKuser();
}
// $this->m_object = kuserPeer::retrieveByPK( $object_id );
break;
}
return $this->m_object;
}
示例10: executeImpl
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
{
$entry_id = $this->getPM("entry_id");
$detailed = $this->getP("detailed", false);
$entry = null;
if ($entry_id) {
$entry = entryPeer::retrieveByPK($entry_id);
}
if (!$entry) {
$this->addError(APIErrors::INVALID_ENTRY_ID, $entry_id);
} else {
$kshow_id = $entry->getKshowId();
$kshow = $entry->getKshow();
if (!$kshow) {
$this->addError(APIErrors::INVALID_KSHOW_ID, $kshow_id);
} else {
$newKshow = myKshowUtils::shalowCloneById($kshow_id, $puser_kuser->getKuserId());
if (!$newKshow) {
$this->addError(APIErrors::KSHOW_CLONE_FAILED, $kshow_id);
} else {
$newEntry = $newKshow->getShowEntry();
$level = $detailed ? objectWrapperBase::DETAIL_LEVEL_DETAILED : objectWrapperBase::DETAIL_LEVEL_REGULAR;
$wrapper = objectWrapperBase::getWrapperClass($newEntry, $level);
// TODO - remove this code when cache works properly when saving objects (in their save method)
$wrapper->removeFromCache("entry", $newEntry->getId());
$this->addMsg("entry", $wrapper);
}
}
}
}
示例11: getTokenizer
/**
* @return kUrlTokenizer
*/
public function getTokenizer()
{
switch ($this->protocol) {
case StorageProfile::PLAY_FORMAT_HTTP:
$name = isset($this->params['http_auth_param_name']) ? $this->params['http_auth_param_name'] : "h";
$key = isset($this->params['http_auth_key']) ? $this->params['http_auth_key'] : false;
$gen = isset($this->params['http_auth_gen']) ? $this->params['http_auth_gen'] : false;
$window = 0;
$entry = entryPeer::retrieveByPK($this->entryId);
if ($entry && $entry->getSecurityPolicy()) {
$window = 30;
}
if ($name && $key !== false && $gen !== false) {
return new kLevel3UrlTokenizer($name, $key, $gen, false, $window);
}
break;
case StorageProfile::PLAY_FORMAT_RTMP:
$name = isset($this->params['rtmp_auth_param_name']) ? $this->params['rtmp_auth_param_name'] : "h";
$key = isset($this->params['rtmp_auth_key']) ? $this->params['rtmp_auth_key'] : false;
$gen = isset($this->params['rtmp_auth_gen']) ? $this->params['rtmp_auth_gen'] : false;
if ($name && $key !== false && $gen !== false) {
return new kLevel3UrlTokenizer($name, $key, $gen, true);
}
break;
}
return null;
}
示例12: createPeriodicSyncPoints
/**
* Creates perioding metadata sync-point events on a live stream
*
* @action createPeriodicSyncPoints
* @actionAlias liveStream.createPeriodicSyncPoints
* @param string $entryId Kaltura live-stream entry id
* @param int $interval Events interval in seconds
* @param int $duration Duration in seconds
*
* @throws KalturaErrors::ENTRY_ID_NOT_FOUND
* @throws KalturaErrors::NO_MEDIA_SERVER_FOUND
* @throws KalturaErrors::MEDIA_SERVER_SERVICE_NOT_FOUND
*/
function createPeriodicSyncPoints($entryId, $interval, $duration)
{
$entryDc = substr($entryId, 0, 1);
if ($entryDc != kDataCenterMgr::getCurrentDcId()) {
$remoteDCHost = kDataCenterMgr::getRemoteDcExternalUrlByDcId($entryDc);
kFileUtils::dumpApiRequest($remoteDCHost, true);
}
$dbEntry = entryPeer::retrieveByPK($entryId);
if (!$dbEntry || $dbEntry->getType() != KalturaEntryType::LIVE_STREAM || !in_array($dbEntry->getSource(), array(KalturaSourceType::LIVE_STREAM, KalturaSourceType::LIVE_STREAM_ONTEXTDATA_CAPTIONS))) {
throw new KalturaAPIException(KalturaErrors::ENTRY_ID_NOT_FOUND, $entryId);
}
/* @var $dbEntry LiveStreamEntry */
$mediaServers = $dbEntry->getMediaServers();
if (!count($mediaServers)) {
throw new KalturaAPIException(KalturaErrors::NO_MEDIA_SERVER_FOUND, $entryId);
}
foreach ($mediaServers as $key => $kMediaServer) {
if ($kMediaServer && $kMediaServer instanceof kLiveMediaServer) {
$mediaServer = $kMediaServer->getMediaServer();
$mediaServerCuePointsService = $mediaServer->getWebService(MediaServer::WEB_SERVICE_CUE_POINTS);
KalturaLog::debug("Sending sync points for DC [" . $mediaServer->getDc() . "] ");
if ($mediaServerCuePointsService && $mediaServerCuePointsService instanceof KalturaMediaServerCuePointsService) {
KalturaLog::debug("Call createTimeCuePoints on DC [" . $mediaServer->getDc() . "] ");
$mediaServerCuePointsService->createTimeCuePoints($entryId, $interval, $duration);
} else {
KalturaLog::debug("Media server service not found on DC: [" . $mediaServer->getDc() . "] ");
}
}
}
}
示例13: contributeMetadataObject
/**
* @param SimpleXMLElement $mrss
* @param SimpleXMLElement $metadata
* @param kMrssParameters $mrssParams
* @return SimpleXMLElement
*/
public function contributeMetadataObject(SimpleXMLElement $mrss, SimpleXMLElement $metadata, kMrssParameters $mrssParams = null, $currentXPath)
{
$currentXPath .= "/*[local-name()='" . $metadata->getName() . "']";
$metadataObject = $mrss->addChild($metadata->getName());
foreach ($metadata->attributes() as $attributeField => $attributeValue) {
$metadataObject->addAttribute($attributeField, $attributeValue);
}
foreach ($metadata as $metadataField => $metadataValue) {
if ($metadataValue instanceof SimpleXMLElement && count($metadataValue)) {
$this->contributeMetadataObject($metadataObject, $metadataValue, $mrssParams, $currentXPath);
} else {
$metadataObject->addChild($metadataField, kString::stringToSafeXml($metadataValue));
$itemXPath = $currentXPath . "/*[local-name()='{$metadataField}']";
if ($mrssParams && is_array($mrssParams->getItemXpathsToExtend()) && in_array($itemXPath, $mrssParams->getItemXpathsToExtend())) {
$relatedEntry = entryPeer::retrieveByPK((string) $metadataValue);
if ($relatedEntry) {
$relatedItemField = $metadataObject->addChild($metadataField . '_item');
$recursionMrssParams = null;
if ($mrssParams) {
$recursionMrssParams = clone $mrssParams;
$recursionMrssParams->setItemXpathsToExtend(array());
// stop the recursion
}
$relatedEntryMrss = kMrssManager::getEntryMrssXml($relatedEntry, $relatedItemField, $recursionMrssParams);
}
}
}
}
}
示例14: addFavorite
/**
const SUBJECT_TYPE_KSHOW = '1';
const SUBJECT_TYPE_ENTRY = '2';
const SUBJECT_TYPE_USER = '3';
*/
public static function addFavorite(favorite $favorite)
{
self::add($favorite);
$type = $favorite->getSubjectType();
$id = $favorite->getSubjectId();
if ($type == favorite::SUBJECT_TYPE_ENTRY) {
$obj = entryPeer::retrieveByPK($id);
if ($obj) {
$v = $obj->getFavorites();
self::inc($v);
$obj->setFavorites($v);
}
} elseif ($type == favorite::SUBJECT_TYPE_KSHOW) {
$obj = kshowPeer::retrieveByPK($id);
if ($obj) {
$v = $obj->getFavorites();
self::inc($v);
$obj->setFavorites($v);
}
} elseif ($type == favorite::SUBJECT_TYPE_USER) {
$obj = kuserPeer::retrieveByPK($id);
if ($obj) {
$v = $obj->getFans();
self::inc($v);
$obj->setFans($v);
}
}
// don't forget to save the modified object
self::add($obj);
}
示例15: getSuitableProfile
/**
* Will return the first virus scan profile of the entry's partner, that defines an entry filter suitable for the given entry.
* @param int $entryId
* @return VirusScanProfile the suitable profile object, or null if none found
*/
public static function getSuitableProfile($entryId)
{
$entry = entryPeer::retrieveByPK($entryId);
if (!$entry) {
KalturaLog::err('Cannot find entry with id [' . $entryId . ']');
return null;
}
if ($entry->getSource() == entry::ENTRY_MEDIA_SOURCE_WEBCAM) {
return null;
}
$cProfile = new Criteria();
$cProfile->addAnd(VirusScanProfilePeer::PARTNER_ID, $entry->getPartnerId());
$cProfile->addAnd(VirusScanProfilePeer::STATUS, VirusScanProfileStatus::ENABLED, Criteria::EQUAL);
$profiles = VirusScanProfilePeer::doSelect($cProfile);
if (!$profiles) {
KalturaLog::debug('No virus scan profiles found for partner [' . $entry->getPartnerId() . ']');
return null;
}
foreach ($profiles as $profile) {
$virusEntryFilter = $profile->getEntryFilterObject();
if ($virusEntryFilter->matches($entry)) {
KalturaLog::debug('Returning profile with id [' . $profile->getId() . ']');
return $profile;
}
}
return null;
}