Storm\Core\Object\Identity::Hash PHP Method

Hash() final public method

Creates a unique hash value from the identity
final public Hash ( ) : string
return string The hash of the entity
    public final function Hash()
    {
        $PropertyData = $this->GetPropertyData();
        ksort($PropertyData);
        return md5(json_encode($PropertyData));
    }

Usage Example

Example #1
0
 public final function GetFromCache(Object\Identity $Identity)
 {
     $IdentityHash = $Identity->Hash();
     return $this->Cache->Contains($IdentityHash) ? $this->Cache->Retrieve($IdentityHash) : null;
 }