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


PHP entryPeer类代码示例

本文整理汇总了PHP中entryPeer的典型用法代码示例。如果您正苦于以下问题:PHP entryPeer类的具体用法?PHP entryPeer怎么用?PHP entryPeer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了entryPeer类的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;
 }
开发者ID:DBezemer,项目名称:server,代码行数:28,代码来源:executeCommandAction.class.php

示例2: 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;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:30,代码来源:kLevel3UrlManager.php

示例3: 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);
             }
         }
     }
 }
开发者ID:DBezemer,项目名称:server,代码行数:30,代码来源:cloneroughcutAction.class.php

示例4: save

 public function save(PropelPDO $con = null)
 {
     if ($this->isColumnModified(accessControlPeer::DELETED_AT)) {
         if ($this->isDefault === true) {
             throw new Exception("Default access control profile can't be deleted");
         }
         $c = new Criteria();
         $c->add(entryPeer::ACCESS_CONTROL_ID, $this->getId());
         $entryCount = entryPeer::doCount($c);
         if ($entryCount > 0) {
             throw new Exception("Access control profile is linked with entries and can't be deleted");
         }
     }
     if ($this->isNew()) {
         $c = new Criteria();
         $c->add(accessControlPeer::PARTNER_ID, $this->partner_id);
         $count = accessControlPeer::doCount($c);
         if ($count >= Partner::MAX_ACCESS_CONTROLS) {
             throw new kCoreException("Max number of access control profiles was reached", kCoreException::MAX_NUMBER_OF_ACCESS_CONTROLS_REACHED);
         }
     }
     parent::save($con);
     // set this conversion profile as partners default
     $partner = PartnerPeer::retrieveByPK($this->partner_id);
     if ($partner && $this->isDefault === true) {
         $partner->setDefaultAccessControlId($this->getId());
         $partner->save();
     }
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:29,代码来源:accessControl.php

示例5: 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);
 }
开发者ID:DBezemer,项目名称:server,代码行数:35,代码来源:myStatisticsMgr.class.php

示例6: getEntry

 public function getEntry()
 {
     if ($this->aEntry == null && $this->getEntryId()) {
         $this->aEntry = entryPeer::retrieveByPKNoFilter($this->getEntryId());
     }
     return $this->aEntry;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:7,代码来源:BulkUploadResult.php

示例7: 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);
 }
开发者ID:kubrickfr,项目名称:server,代码行数:26,代码来源:SphinxCuePointCriteria.php

示例8: 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);
         }
     }
 }
开发者ID:DBezemer,项目名称:server,代码行数:27,代码来源:kQuizPdf.php

示例9: execute

 public function execute()
 {
     // keywords & page
     // keywords
     //		$keywords = $this->request->getRequestParameter ( "keywords" , "" );
     // page
     //		$page = $this->request->getRequestParameter ( "page" , "1" );
     $partner_id = $this->getP("partner_id", null);
     if (false && $partner_id) {
         $criteria_filter = enrtyPeer::getCriteriaFilter();
         $criteria = $criteria_filter->getFilter();
         $criteria->addAnd(entryPeer::PARTNER_ID, "(" . entryPeer::PARTNER_ID . "<100 OR " . entryPeer::PARTNER_ID . "={$partner_id} )", Criteria::CUSTOM);
         entryPeer::enable();
     }
     $page_size = 20;
     $entry_filter = new entryFilter();
     $entry_pager = new mySmartPager($this, "entry", $page_size);
     $act = new AJAX_getEntriesAction();
     $act->setIdList(NULL);
     $act->setSortAlias("ids");
     $act->setPublicOnly(true);
     $act->skip_count = false;
     $this->entry_results = $act->fetchPage($this, $entry_filter, $entry_pager);
     $this->getResponse()->setHttpHeader("Content-Type", "text/xml; charset=utf-8");
     $this->number_of_results = $entry_pager->getNumberOfResults();
     $this->number_of_pages = $entry_pager->getNumberOfPages();
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:27,代码来源:searchEntriesAction.class.php

示例10: executeImpl

 public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
 {
     $obj_type = $this->getPM("obj_type");
     $obj_id = $this->getPM("obj_id");
     $command = $this->getPM("command");
     $value = $this->getP("value");
     $extra_info = $this->getP("extra_info");
     if ($obj_type == "entry") {
         $entry = entryPeer::retrieveByPK($obj_id);
         if ($command == "view") {
             PartnerActivity::incrementActivity($partner_id, PartnerActivity::PARTNER_ACTIVITY_KDP, PartnerActivity::PARTNER_SUB_ACTIVITY_KDP_VIEWS);
             myStatisticsMgr::incEntryViews($entry);
         } elseif ($command == "play") {
             PartnerActivity::incrementActivity($partner_id, PartnerActivity::PARTNER_ACTIVITY_KDP, PartnerActivity::PARTNER_SUB_ACTIVITY_KDP_PLAYS);
             myStatisticsMgr::incEntryPlays($entry);
         }
     } elseif ($obj_type == "kshow") {
         $kshow = kshowPeer::retrieveByPK($obj_id);
         if ($command == "view") {
             PartnerActivity::incrementActivity($partner_id, PartnerActivity::PARTNER_ACTIVITY_KDP, PartnerActivity::PARTNER_SUB_ACTIVITY_KDP_VIEWS);
             myStatisticsMgr::incKshowViews($kshow);
         } elseif ($command == "play") {
             PartnerActivity::incrementActivity($partner_id, PartnerActivity::PARTNER_ACTIVITY_KDP, PartnerActivity::PARTNER_SUB_ACTIVITY_KDP_PLAYS);
             myStatisticsMgr::incKshowPlays($kshow);
         }
     }
     $this->addMsg("collectedStats", "{$obj_type}, {$obj_id}, {$command}, {$value}, {$extra_info}");
 }
开发者ID:DBezemer,项目名称:server,代码行数:28,代码来源:collectstatsAction.class.php

示例11: 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;
 }
开发者ID:DBezemer,项目名称:server,代码行数:30,代码来源:moderation.php

示例12: executeImpl

 public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
 {
     if (!$puser_kuser) {
         $this->addError(APIErrors::INVALID_USER_ID, $puser_id);
         return;
     }
     $time_offset = $this->getPM("time_offset");
     $entry_ids = $this->getPM("entry_ids");
     $detailed = $this->getP("detailed", false);
     $separator = $this->getP("separator", ",");
     $id_arr = explode($separator, $entry_ids);
     $limit = 50;
     $id_arr = array_splice($id_arr, 0, $limit);
     $entries = entryPeer::retrieveByPKs($id_arr);
     $updated_entries = array();
     if (!$entries) {
         $this->addError(APIErrors::INVALID_ENTRY_IDS, $entry_ids);
     } else {
         foreach ($entries as $entry) {
             if (!myEntryUtils::createThumbnailFromEntry($entry, $entry, $time_offset)) {
                 $this->addError(APIErrors::INVALID_ENTRY_TYPE, "ENTRY_TYPE_MEDIACLIP [" . $entry->getId() . "]");
                 continue;
             }
             $updated_entries[] = $entry;
             myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_ENTRY_UPDATE_THUMBNAIL, $entry);
             $wrapper = objectWrapperBase::getWrapperClass($entry, objectWrapperBase::DETAIL_LEVEL_DETAILED);
             $wrapper->removeFromCache("entry", $entry->getId());
         }
     }
     $this->addMsg("entries", objectWrapperBase::getWrapperClass($updated_entries, objectWrapperBase::DETAIL_LEVEL_REGULAR));
 }
开发者ID:DBezemer,项目名称:server,代码行数:31,代码来源:updateentriesthumbnailsAction.class.php

示例13: 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();
     }
 }
开发者ID:panigh,项目名称:server,代码行数:60,代码来源:categoryEntry.php

示例14: 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);
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:33,代码来源:kUrlManager.php

示例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;
 }
开发者ID:kubrickfr,项目名称:server,代码行数:32,代码来源:VirusScanProfilePeer.php


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