예제 #1
0
 /**
  * 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;
 }