Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | List of all members
eZ\Publish\SPI\User\Identity Interface Reference

Interface for a user identity. More...

## Public Member Functions
| addInformation (array $information)
| Registers several pieces of information in the identity. More...
| setInformation ($informationName, $informationValue)
| Registers an information in the identity. More...
| replaceInformation (array $information)
| Replaces the information already registered in the identity. More...
| getInformation ()
| Returns registered information. More...
| getHash ()
| Returns the hash of the current identity (e.g. More...

## Detailed Description

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.

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

Definition at line 18 of file Identity.php.

## Member Function Documentation

## ◆ addInformation()

eZ\Publish\SPI\User\Identity::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.

## ◆ getHash()

eZ\Publish\SPI\User\Identity::getHash | ( |  | ) |

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

md5, sha1...).

Returns
  string

## ◆ getInformation()

eZ\Publish\SPI\User\Identity::getInformation | ( |  | ) |

Returns registered information.

Returns
  array

## ◆ replaceInformation()

eZ\Publish\SPI\User\Identity::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.

## ◆ setInformation()

eZ\Publish\SPI\User\Identity::setInformation | ( |  | $informationName,
|  |  | $informationValue
| ) |  |

Registers an information in the identity.

Parameters

  string | $informationName |
  scalar | $informationValue |

The documentation for this interface was generated from the following file:

- Identity.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.