Skip to content

Kirby 5.0.2

$file->changeStorage()

Moves or copies the model to a new storage instance/type

$file->changeStorage() has been marked as unstable. It might be changed in a future Kirby major or minor release without being considered a breaking change. Use with caution.

$file->changeStorage(Kirby\Content\Storage|string $toStorage, bool $copy = false): Kirby\Cms\File

Parameters

Name Type Default
$toStoragerequired Kirby\Content\Storageorstring no default value
$copy bool false

Return type

Kirby\Cms\File

This method does not modify the existing $file object but returns a new object with the changes applied. Learn more →

Parent class

Kirby\Cms\File inherited from Kirby\Cms\ModelWithContent