Skip to content

Kirby 6.0.0

$modelWithContent->changeStorage()

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

$modelWithContent->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.

$modelWithContent->changeStorage(Storage|string $toStorage, bool $copy = false): ModelWithContent

Parameters

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

Return type

Kirby\Cms\ModelWithContent

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

Parent class

Kirby\Cms\ModelWithContent