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


PHP kEntitlementUtils::isEntitledForEditEntry方法代码示例

本文整理汇总了PHP中kEntitlementUtils::isEntitledForEditEntry方法的典型用法代码示例。如果您正苦于以下问题:PHP kEntitlementUtils::isEntitledForEditEntry方法的具体用法?PHP kEntitlementUtils::isEntitledForEditEntry怎么用?PHP kEntitlementUtils::isEntitledForEditEntry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在kEntitlementUtils的用法示例。


在下文中一共展示了kEntitlementUtils::isEntitledForEditEntry方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: doFromObject

 public function doFromObject($dbObject, KalturaDetachedResponseProfile $responseProfile = null)
 {
     parent::doFromObject($dbObject, $responseProfile);
     $dbEntry = entryPeer::retrieveByPK($dbObject->getEntryId());
     if (!kEntitlementUtils::isEntitledForEditEntry($dbEntry)) {
         /**
          * @var kQuiz $kQuiz
          */
         $kQuiz = QuizPlugin::validateAndGetQuiz($dbEntry);
         $dbUserEntry = UserEntryPeer::retrieveByPK($this->quizUserEntryId);
         if ($dbUserEntry && $dbUserEntry->getStatus() == QuizPlugin::getCoreValue('UserEntryStatus', QuizUserEntryStatus::QUIZ_SUBMITTED)) {
             if (!$kQuiz->getShowCorrectAfterSubmission()) {
                 $this->isCorrect = KalturaNullableBoolean::NULL_VALUE;
                 $this->correctAnswerKeys = null;
                 $this->explanation = null;
             }
         } else {
             if (!$kQuiz->getShowResultOnAnswer()) {
                 $this->isCorrect = KalturaNullableBoolean::NULL_VALUE;
             }
             if (!$kQuiz->getShowCorrectKeyOnAnswer()) {
                 $this->correctAnswerKeys = null;
                 $this->explanation = null;
             }
         }
     }
 }
开发者ID:DBezemer,项目名称:server,代码行数:27,代码来源:KalturaAnswerCuePoint.php

示例2: validateForInsert

 public function validateForInsert($propertiesToSkip = array())
 {
     parent::validateForInsert($propertiesToSkip);
     $dbEntry = entryPeer::retrieveByPK($this->entryId);
     QuizPlugin::validateAndGetQuiz($dbEntry);
     if (!kEntitlementUtils::isEntitledForEditEntry($dbEntry)) {
         throw new KalturaAPIException(KalturaErrors::INVALID_USER_ID);
     }
 }
开发者ID:DBezemer,项目名称:server,代码行数:9,代码来源:KalturaQuestionCuePoint.php

示例3: validateAndUpdateQuizData

 /**
  * if user is entitled for this action will update quizData on entry
  * @param entry $dbEntry
  * @param KalturaQuiz $quiz
  * @param int $currentVersion
  * @param kQuiz|null $newQuiz
  * @return KalturaQuiz
  * @throws KalturaAPIException
  */
 private function validateAndUpdateQuizData(entry $dbEntry, KalturaQuiz $quiz, $currentVersion = 0, kQuiz $newQuiz = null)
 {
     if (!kEntitlementUtils::isEntitledForEditEntry($dbEntry)) {
         KalturaLog::debug('Update quiz allowed only with admin KS or entry owner or co-editor');
         throw new KalturaAPIException(KalturaErrors::INVALID_USER_ID);
     }
     $quizData = $quiz->toObject($newQuiz);
     $quizData->setVersion($currentVersion + 1);
     QuizPlugin::setQuizData($dbEntry, $quizData);
     $dbEntry->setIsTrimDisabled(true);
     $dbEntry->save();
     $quiz->fromObject($quizData);
     return $quiz;
 }
开发者ID:DBezemer,项目名称:server,代码行数:23,代码来源:QuizService.php


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