Inheritance: implements Storm\Core\Object\IEntityMap, use trait Storm\Core\Helpers\Type
Exemple #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));
 }
Exemple #2
0
 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());
 }
Exemple #3
0
 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()));
 }