當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。