Interface

eZ\Publish\SPI\User\Identity

interface Identity

Interface for a user identity.

One can add any kind of information that can then be hashed and used as a fingerprint.

Typical use case is for content cache variation that you want to make vary on a bunch of user information (e.g. assigned roles). The more you add information, the more specific and fine grained your cache variation will be.

Methods

addInformation(array $information)

Registers several pieces of information in the identity.

setInformation(string $informationName, scalar $informationValue)

Registers an information in the identity.

replaceInformation(array $information)

Replaces the information already registered in the identity.

array getInformation()

Returns registered information.

string getHash()

Returns the hash of the current identity (e.g.

Details

at line 27
public addInformation(array $information)

Registers several pieces of information in the identity.

Parameters

array $information Hash where key is the information type and value is a scalar.

at line 35
public setInformation(string $informationName, scalar $informationValue)

Registers an information in the identity.

Parameters

string $informationName
scalar $informationValue

at line 42
public replaceInformation(array $information)

Replaces the information already registered in the identity.

Parameters

array $information Hash where key is the information type and value is a scalar.

at line 49
public array getInformation()

Returns registered information.

Return Value

array

at line 56
public string getHash()

Returns the hash of the current identity (e.g.

md5, sha1...).

Return Value

string