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; }
/** * 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; }