PHPackages                             tp/ident - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tp/ident

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tp/ident
========

A library to add identity to objects

216PHP

Since Nov 8Pushed 11y ago2 watchersCompare

[ Source](https://github.com/tPl0ch/ident)[ Packagist](https://packagist.org/packages/tp/ident)[ RSS](/packages/tp-ident/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

ident
=====

[](#ident)

[![Build Status](https://camo.githubusercontent.com/d5f3f9f265d8b954e3e72b4d601e9d212655b6960669e6448a864b306dc19b22/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f74506c3063682f6964656e742f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/tPl0ch/ident/build-status/master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/4f177743dd3a5c8fcfa0e73d1158c28c139dd62523d789ee425d5a1b3cb86152/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f74506c3063682f6964656e742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/tPl0ch/ident/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/6f307393ccd8bf759e734fb1baefac013ee59212c6b2a4304fdc3733da021abb/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f74506c3063682f6964656e742f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/tPl0ch/ident/?branch=master)

A library to provide an interface to object "identities and identifiers".

###### Note

[](#note)

This documentation is still a work in progress and subject to change at any given time.

Features
--------

[](#features)

- POC of a common interface to object identity
- Various implementations of Identifiers (`UuidIdentifier`, `BinaryUuidIdentifier`, `StringIndentifier`, `NullIdentifier`)
- Annotation driven configuration (YAML and XML are in the pipeline) of object identifier(s) (requires `jms/metadata: >= 1.1` and `doctrine/annotations: >= 1.0`).
- Doctrine2 ORM integration (requires `doctrine/orm: >= 2.x`).
- `BinaryUuidType` DBAL Type (requires `doctrine/dbal: >= 2.5.x-dev`) to save some storage in the underlying database implementation (though you should keep index fragmentation in mind when using this as a primary key).
- A `HashFactory` to easily generate unique hashes of various algorithms based of random byte data (requires `symfony/security: >=2.3`).

Introduction
------------

[](#introduction)

**Identity** is a very important concept in our every day lives. If you imagine a class `Person`, it is clear that this `Person` must have an identity.

There is a vast variety of various implementations of `Identity`, and this library tries to provide a common **interface** to deal with this.

A `Person` **`HasIdentity`**:

```
