public static function fromStorageProfileArray(array $arr) { $newArr = new KalturaStorageProfileArray(); foreach ($arr as $obj) { $nObj = new KalturaStorageProfile(); $nObj->fromObject($obj); $newArr[] = $nObj; } return $newArr; }
/** * 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; }
/** * 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; }