Skip to content

Kirby 4.4.1

$users->add()

Adds a single user or an entire second collection to the current collection

$users->add(\Kirby\Cms\Users|\Kirby\Cms\User|string $object): Kirby\Cms\Users

Parameters

Name Type Default
$object * Kirby\Cms\Users|Kirby\Cms\User|string

Return type

Kirby\Cms\Users

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

Exceptions

Type Description
Kirby\Exception\InvalidArgumentException When no User or Users object or an ID of an existing user is passed

Parent class

Kirby\Cms\Users