Skip to content

Kirby 5.0.4

VersionRules::ensure()

Checks if a version/language combination exists and otherwise will throw a NotFoundException

VersionRules::ensure() 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.

VersionRules::ensure(Kirby\Content\Version $version, Kirby\Cms\Language $language): void

Parameters

Name Type Default
$versionrequired Kirby\Content\Version no default value
$languagerequired Kirby\Cms\Language no default value

Exceptions

Type Description
Kirby\Exception\NotFoundException If the version does not exist

Parent class

Kirby\Content\VersionRules