/**
* Clear all user persistence cache.
*
* @param int|null $id Purges all users cache if null
* @throws \eZ\Publish\Core\Base\Exceptions\InvalidArgumentType On invalid $id type
*/
public function user($id = null)
{
if ($this->allCleared === true || $this->isSwitchedOff()) {
return;
}
if ($id === null) {
$this->cache->clear('user');
} elseif (is_scalar($id)) {
$this->cache->clear('user', $id);
} else {
throw new InvalidArgumentType('$id', 'int|null', $id);
}
}