public function fromObject($source_object)
 {
     parent::fromObject($source_object);
     $categories = explode(',', $this->categories);
     $strCategories = array();
     foreach ($categories as $category) {
         $strCategories[] = $this->getCategoryName($category);
     }
     $this->categories = implode(',', $strCategories);
 }
 public function doFromObject($source_object, KalturaDetachedResponseProfile $responseProfile = null)
 {
     parent::doFromObject($source_object, $responseProfile);
     $categories = explode(',', $this->categories);
     $strCategories = array();
     foreach ($categories as $category) {
         $strCategories[] = $this->getCategoryName($category);
     }
     $this->categories = implode(',', $strCategories);
 }
 function update($id, KalturaBaseSyndicationFeed $syndicationFeed)
 {
     $kparams = array();
     $this->client->addParam($kparams, "id", $id);
     $this->client->addParam($kparams, "syndicationFeed", $syndicationFeed->toParams());
     $this->client->queueServiceActionCall("syndicationfeed", "update", $kparams);
     if ($this->client->isMultiRequest()) {
         return null;
     }
     $resultObject = $this->client->doQueue();
     $this->client->throwExceptionIfError($resultObject);
     $this->client->validateObjectType($resultObject, "KalturaBaseSyndicationFeed");
     return $resultObject;
 }
예제 #4
0
 /**
  * Update Syndication Feed by ID
  * 
  * @action update
  * @param string $id
  * @param KalturaBaseSyndicationFeed $syndicationFeed
  * @return KalturaBaseSyndicationFeed
  */
 public function updateAction($id, KalturaBaseSyndicationFeed $syndicationFeed)
 {
     $syndicationFeedDB = syndicationFeedPeer::retrieveByPK($id);
     if (!$syndicationFeedDB) {
         throw new KalturaAPIException(KalturaErrors::ENTRY_ID_NOT_FOUND, $id);
     }
     if ($syndicationFeed instanceof KalturaGenericXsltSyndicationFeed && $syndicationFeed->xslt != null) {
         $syndicationFeed->validateXslt();
         $syndicationFeedDB->incrementVersion();
         $syndicationFeedDB->save();
     }
     $syndicationFeed->type = null;
     if ($syndicationFeed instanceof KalturaGenericXsltSyndicationFeed && $syndicationFeed->xslt != null) {
         $key = $syndicationFeedDB->getSyncKey(genericSyndicationFeed::FILE_SYNC_SYNDICATION_FEED_XSLT);
         kFileSyncUtils::file_put_contents($key, $syndicationFeed->xslt);
     }
     $syndicationFeed = $syndicationFeed->toUpdatableObject($syndicationFeedDB, array('type'));
     $syndicationFeedDB->save();
     $syndicationFeed = KalturaSyndicationFeedFactory::getInstanceByType($syndicationFeedDB->getType());
     $syndicationFeed->fromObject($syndicationFeedDB);
     return $syndicationFeed;
 }
예제 #5
0
 /**
  * Update Syndication Feed by ID
  * 
  * @action update
  * @param string $id
  * @param KalturaBaseSyndicationFeed $syndicationFeed
  * @return KalturaBaseSyndicationFeed
  * @throws KalturaErrors::INVALID_FEED_ID
  */
 public function updateAction($id, KalturaBaseSyndicationFeed $syndicationFeed)
 {
     $syndicationFeedDB = syndicationFeedPeer::retrieveByPK($id);
     if (!$syndicationFeedDB) {
         throw new KalturaAPIException(KalturaErrors::INVALID_FEED_ID, $id);
     }
     $syndicationFeed->validateStorageId($this->getPartnerId());
     $syndicationFeed->toUpdatableObject($syndicationFeedDB, array('type'));
     if ($syndicationFeed instanceof KalturaGenericXsltSyndicationFeed && $syndicationFeed->xslt != null) {
         if (!$syndicationFeedDB instanceof genericSyndicationFeed) {
             throw new KalturaAPIException(KalturaErrors::INVALID_FEED_TYPE, get_class($syndicationFeedDB));
         }
         $syndicationFeedDB->incrementVersion();
     }
     $syndicationFeedDB->save();
     if ($syndicationFeed instanceof KalturaGenericXsltSyndicationFeed && $syndicationFeed->xslt != null) {
         $key = $syndicationFeedDB->getSyncKey(genericSyndicationFeed::FILE_SYNC_SYNDICATION_FEED_XSLT);
         kFileSyncUtils::file_put_contents($key, $syndicationFeed->xslt);
     }
     $syndicationFeed->type = null;
     $syndicationFeed = KalturaSyndicationFeedFactory::getInstanceByType($syndicationFeedDB->getType());
     $syndicationFeed->fromObject($syndicationFeedDB, $this->getResponseProfile());
     return $syndicationFeed;
 }
 public function getMapBetweenObjects()
 {
     return array_merge(parent::getMapBetweenObjects(), self::$mapBetweenObjects);
 }