Skip to content

Kirby 6.0.0

$collection->update()

Updates an object in the collection

$collection->update(string|mixed $key, mixed|null $object = null): Collection

Parameters

Name Type Default Description
$keyrequired stringormixed no default value Key or object to update
$object mixedornull null New object for the key

Return type

Kirby\Cms\Collection

This method modifies the existing $collection object it is applied to and returns it again.

Parent class

Kirby\Cms\Collection