/**
  * Update live channel segment by id
  * 
  * @action update
  * @param int $id
  * @param KalturaLiveChannelSegment $liveChannelSegment
  * @return KalturaLiveChannelSegment
  * 
  * @throws KalturaErrors::LIVE_CHANNEL_SEGMENT_ID_NOT_FOUND
  */
 function updateAction($id, KalturaLiveChannelSegment $liveChannelSegment)
 {
     $dbLiveChannelSegment = LiveChannelSegmentPeer::retrieveByPK($id);
     if (!$dbLiveChannelSegment) {
         throw new KalturaAPIException(KalturaErrors::LIVE_CHANNEL_SEGMENT_ID_NOT_FOUND, $id);
     }
     $liveChannelSegment->toUpdatableObject($dbLiveChannelSegment);
     $dbLiveChannelSegment->save();
     $liveChannelSegment = new KalturaLiveChannelSegment();
     $liveChannelSegment->fromObject($dbLiveChannelSegment, $this->getResponseProfile());
     return $liveChannelSegment;
 }
 public static function fromDbArray($arr, KalturaDetachedResponseProfile $responseProfile = null)
 {
     $newArr = new KalturaLiveChannelSegmentArray();
     if ($arr == null) {
         return $newArr;
     }
     foreach ($arr as $obj) {
         $nObj = new KalturaLiveChannelSegment();
         $nObj->fromObject($obj, $responseProfile);
         $newArr[] = $nObj;
     }
     return $newArr;
 }
Example #3
0
 /**
  * Update live channel segment by id
  * 
  * @param int $id 
  * @param KalturaLiveChannelSegment $liveChannelSegment 
  * @return KalturaLiveChannelSegment
  */
 function update($id, KalturaLiveChannelSegment $liveChannelSegment)
 {
     $kparams = array();
     $this->client->addParam($kparams, "id", $id);
     $this->client->addParam($kparams, "liveChannelSegment", $liveChannelSegment->toParams());
     $this->client->queueServiceActionCall("livechannelsegment", "update", $kparams);
     if ($this->client->isMultiRequest()) {
         return $this->client->getMultiRequestResult();
     }
     $resultObject = $this->client->doQueue();
     $this->client->throwExceptionIfError($resultObject);
     $this->client->validateObjectType($resultObject, "KalturaLiveChannelSegment");
     return $resultObject;
 }