\Phabstractic\FeaturesIdentityTrait

The Identity trait

Encapsulates all the logic necessary for delivering unique identifiers specific to a class. Use this to get unique identifiers for datums that are created in a particular class globally.

CHANGELOG

1.0: Created and documented - April 10th, 2015 2.0: Adapted for Primus2, change counter access - September 5th, 2015 3.0: reformatted for inclusion in phabstractic - July 9th, 2016

Summary

Methods
Properties
Constants
No public methods found
No public properties found
No constants found
getNewIdentity()
$identityCounter
$identityPrefix
N/A
No private methods found
No private properties found
N/A

Properties

$identityCounter

$identityCounter : mixed

The Global Identity Generator Marker

When the identity is polled, this marker is 'advanced'. It's static to the class, in that way it's unique for each one.

Type

mixed — The current identity

$identityPrefix

$identityPrefix : mixed

The Identity Marker Prefix

Specific to a given class, this is placed with/in front of the identity (context) This is a bit strange to understand why it's not static, but imagine a finer grain of control

Type

mixed — The class's context/marker prefix

Methods

getNewIdentity()

getNewIdentity() : mixed

Poll for New Identity

Overridable in a using class so that anything could be used as an identity, but by default it's an integer attached to a prefix. As new identities are polled, the integer increases.

Returns

mixed —

The new identity