W3cubDocs

/Symfony 2.7

Symfony\Component\Security\Acl\Model\ObjectIdentityInterface

interface ObjectIdentityInterface

Represents the identity of an individual domain object instance.

Methods

bool equals(ObjectIdentityInterface $identity)

We specifically require this method so we can check for object equality explicitly, and do not have to rely on referencial equality instead.

string getIdentifier()

Obtains a unique identifier for this object.

string getType()

Returns a type for the domain object.

Details

public bool equals(ObjectIdentityInterface $identity)

We specifically require this method so we can check for object equality explicitly, and do not have to rely on referencial equality instead.

Though in most cases, both checks should result in the same outcome.

Referential Equality: $object1 === $object2 Example for Object Equality: $object1->getId() === $object2->getId()

Parameters

ObjectIdentityInterface $identity

Return Value

bool

public string getIdentifier()

Obtains a unique identifier for this object.

The identifier must not be re-used for other objects with the same type.

Return Value

string cannot return null

public string getType()

Returns a type for the domain object.

Typically, this is the PHP class name.

Return Value

string cannot return null

© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/2.7/Symfony/Component/Security/Acl/Model/ObjectIdentityInterface.html