public function fromObject($source_object) { /* @var $source_object CaptionAssetItem */ $ret = parent::fromObject($source_object); $this->asset = new KalturaCaptionAsset(); $this->asset->fromObject($source_object->getAsset()); $entry = $source_object->getEntry(); $this->entry = KalturaEntryFactory::getInstanceByType($entry->getType()); $this->entry->fromObject($entry); return $ret; }
public static function fromDbArray($arr, KalturaDetachedResponseProfile $responseProfile = null) { $newArr = new KalturaCaptionAssetArray(); if ($arr == null) { return $newArr; } foreach ($arr as $obj) { $nObj = new KalturaCaptionAsset(); $nObj->fromObject($obj, $responseProfile); $newArr[] = $nObj; } return $newArr; }
public static function fromDbArray($arr) { $newArr = new KalturaCaptionAssetArray(); if ($arr == null) { return $newArr; } foreach ($arr as $obj) { $nObj = new KalturaCaptionAsset(); $nObj->fromObject($obj); $newArr[] = $nObj; } return $newArr; }
public function doFromObject($source_object, KalturaDetachedResponseProfile $responseProfile = null) { /* @var $source_object CaptionAssetItem */ $ret = parent::doFromObject($source_object, $responseProfile); if ($this->shouldGet('asset', $responseProfile)) { $this->asset = new KalturaCaptionAsset(); $this->asset->fromObject($source_object->getAsset()); } if ($this->shouldGet('entry', $responseProfile)) { $entry = $source_object->getEntry(); if ($entry) { $this->entry = KalturaEntryFactory::getInstanceByType($entry->getType()); $this->entry->fromObject($entry); } } return $ret; }
/** * Update caption asset * * @param string $id * @param KalturaCaptionAsset $captionAsset * @return KalturaCaptionAsset */ function update($id, KalturaCaptionAsset $captionAsset) { $kparams = array(); $this->client->addParam($kparams, "id", $id); $this->client->addParam($kparams, "captionAsset", $captionAsset->toParams()); $this->client->queueServiceActionCall("caption_captionasset", "update", $kparams); if ($this->client->isMultiRequest()) { return $this->client->getMultiRequestResult(); } $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "KalturaCaptionAsset"); return $resultObject; }
/** * @action get * @param string $captionAssetId * @return KalturaCaptionAsset * * @throws KalturaCaptionErrors::CAPTION_ASSET_ID_NOT_FOUND */ public function getAction($captionAssetId) { $captionAssetsDb = assetPeer::retrieveById($captionAssetId); if (!$captionAssetsDb || !$captionAssetsDb instanceof CaptionAsset) { throw new KalturaAPIException(KalturaCaptionErrors::CAPTION_ASSET_ID_NOT_FOUND, $captionAssetId); } $captionAssets = new KalturaCaptionAsset(); $captionAssets->fromObject($captionAssetsDb); return $captionAssets; }