Copied!

Identity

Identity.php : 18

Interface for a user identity.

since 5.4. Will be removed in 6.0. Use FOSHttpCacheBundle user context feature instead.

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.

Tags
Deprecated

since 5.4. Will be removed in 6.0. Use FOSHttpCacheBundle user context feature instead.

Methods

publicaddInformation()

Identity.php : 25

Registers several pieces of information in the identity.

public addInformation(array<string|int, mixed> $information) : mixed

Parameters

Name Type Default value Description
$information array<string|int, mixed> -

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

publicgetHash()

Identity.php : 54

Returns the hash of the current identity (e.g. md5, sha1...).

public getHash() : string

Return values

string

publicgetInformation()

Identity.php : 47

Returns registered information.

public getInformation() : array<string|int, mixed>

Return values

array<string|int, mixed>

publicreplaceInformation()

Identity.php : 40

Replaces the information already registered in the identity.

public replaceInformation(array<string|int, mixed> $information) : mixed

Parameters

Name Type Default value Description
$information array<string|int, mixed> -

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

publicsetInformation()

Identity.php : 33

Registers an information in the identity.

public setInformation(string $informationName, scalar $informationValue) : mixed

Parameters

Name Type Default value Description
$informationName string - -
$informationValue scalar - -