public static function fromStorageProfileArray(array $arr) { $newArr = new KalturaStorageProfileArray(); foreach ($arr as $obj) { $nObj = new KalturaStorageProfile(); $nObj->fromObject($obj); $newArr[] = $nObj; } return $newArr; }
/** * Update storage profile by id * * @action update * @param int $storageProfileId * @param KalturaStorageProfile $storageProfile * @return KalturaStorageProfile */ function updateAction($storageProfileId, KalturaStorageProfile $storageProfile) { $dbStorageProfile = StorageProfilePeer::retrieveByPK($storageProfileId); if (!$dbStorageProfile) { throw new KalturaAPIException(KalturaErrors::INVALID_OBJECT_ID, $storageProfileId); } $dbStorageProfile = $storageProfile->toUpdatableObject($dbStorageProfile); $dbStorageProfile->save(); $storageProfile->fromObject($dbStorageProfile); return $storageProfile; }
public function toInsertableObject($object_to_fill = null, $props_to_skip = array()) { if (is_null($object_to_fill)) { $object_to_fill = new AmazonS3StorageProfile(); } return parent::toInsertableObject($object_to_fill, $props_to_skip); }
public static function fromDbArray(array $arr, KalturaDetachedResponseProfile $responseProfile = null) { $newArr = new KalturaStorageProfileArray(); foreach ($arr as $obj) { /* @var $obj StorageProfile */ $nObj = KalturaStorageProfile::getInstanceByType($obj->getProtocol()); $nObj->fromObject($obj, $responseProfile); $newArr[] = $nObj; } return $newArr; }
function add(KalturaStorageProfile $storageProfile) { $kparams = array(); $this->client->addParam($kparams, "storageProfile", $storageProfile->toParams()); $this->client->queueServiceActionCall("storageprofile", "add", $kparams); if ($this->client->isMultiRequest()) { return null; } $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "KalturaStorageProfile"); return $resultObject; }
/** * Update storage profile by id * * @action update * @param int $storageProfileId * @param KalturaStorageProfile $storageProfile * @return KalturaStorageProfile */ function updateAction($storageProfileId, KalturaStorageProfile $storageProfile) { $dbStorageProfile = StorageProfilePeer::retrieveByPK($storageProfileId); if (!$dbStorageProfile) { throw new KalturaAPIException(KalturaErrors::INVALID_OBJECT_ID, $storageProfileId); } $dbStorageProfile = $storageProfile->toUpdatableObject($dbStorageProfile); $dbStorageProfile->save(); $protocol = $dbStorageProfile->getProtocol(); $storageProfile = KalturaStorageProfile::getInstanceByType($protocol); $storageProfile->fromObject($dbStorageProfile, $this->getResponseProfile()); return $storageProfile; }
/** * Adds a storage profile to the Kaltura DB. * * @action add * @param KalturaStorageProfile $storageProfile * @return KalturaStorageProfile */ function addAction(KalturaStorageProfile $storageProfile) { if (!$storageProfile->status) { $storageProfile->status = KalturaStorageProfileStatus::DISABLED; } $dbStorageProfile = $storageProfile->toInsertableObject(); $dbStorageProfile->setPartnerId($this->impersonatedPartnerId); $dbStorageProfile->save(); $storageProfile->fromObject($dbStorageProfile); return $storageProfile; }