public function testDeterminesWhetherEntityHasAnIdentity() { $EntityWithIdentity = $this->Entity(5); $EntityWithoutIdentity = $this->Entity(null); $this->assertTrue($this->EntityMap->HasIdentity($EntityWithIdentity)); $this->assertFalse($this->EntityMap->HasIdentity($EntityWithoutIdentity)); }
public function __construct() { parent::__construct(); $this->EntityConstructor = $this->EntityConstructor(); if (!$this->EntityConstructor instanceof Construction\IEntityConstructor) { throw new Object\ObjectException('The supplied entity constructor must implement %s: %s given', Construction\IEntityConstructor::IEntityConstructorType, \Storm\Core\Utilities::GetTypeOrClass($this->EntityConstructor)); } if ($this->EntityConstructor->HasEntityType()) { throw new Object\ObjectException('The supplied entity constructor %s already has an entity type %s', get_class($this->EntityConstructor), $this->EntityConstructor->GetEntityType()); } $this->EntityConstructor->SetEntityType($this->GetEntityType()); }
public function __construct(EntityMap $EntityMap, array $Properties = null, $IsSingleEntity = false, \Storm\Core\Object\ICriterion $Criterion = null) { parent::__construct($EntityMap->GetEntityType(), $Properties ?: $EntityMap->GetProperties(), $IsSingleEntity, $Criterion ?: new Criterion($EntityMap->GetEntityType())); }