Storm\Core\Object\EntityMap::HasIdentity PHP Method

HasIdentity() final public method

{@inheritDoc}
final public HasIdentity ( $Entity )
    public final function HasIdentity($Entity)
    {
        foreach ($this->Identity($Entity) as $Value) {
            if ($Value === null) {
                return false;
            }
        }
        return true;
    }

Usage Example

Example #1
0
 public function testDeterminesWhetherEntityHasAnIdentity()
 {
     $EntityWithIdentity = $this->Entity(5);
     $EntityWithoutIdentity = $this->Entity(null);
     $this->assertTrue($this->EntityMap->HasIdentity($EntityWithIdentity));
     $this->assertFalse($this->EntityMap->HasIdentity($EntityWithoutIdentity));
 }