コード例 #1
0
ファイル: KalturaBaseEntry.php プロジェクト: DBezemer/server
 public function doFromObject($sourceObject, KalturaDetachedResponseProfile $responseProfile = null)
 {
     if (!$sourceObject) {
         return;
     }
     entryPeer::addValidatedEntry($sourceObject->getId());
     parent::doFromObject($sourceObject, $responseProfile);
     $partnerId = kCurrentContext::$ks_partner_id ? kCurrentContext::$ks_partner_id : kCurrentContext::$partner_id;
     if (implode(',', kEntitlementUtils::getKsPrivacyContext()) != kEntitlementUtils::DEFAULT_CONTEXT . $partnerId) {
         $this->categories = null;
         $this->categoriesIds = null;
     }
     if (!kConf::hasParam('protect_userid_in_api') || !in_array($sourceObject->getPartnerId(), kConf::get('protect_userid_in_api')) || !in_array(kCurrentContext::getCurrentSessionType(), array(kSessionBase::SESSION_TYPE_NONE, kSessionBase::SESSION_TYPE_WIDGET))) {
         if ($this->shouldGet('userId', $responseProfile)) {
             $this->userId = $sourceObject->getPuserId();
         }
         if ($this->shouldGet('creatorId', $responseProfile)) {
             $this->creatorId = $sourceObject->getCreatorPuserId();
         }
     }
 }