Example #1
0
 function finish()
 {
     foreach ($this->properties as $name => $tuples) {
         $property = $this->logicalSchema->getProperty($name);
         $setter = $property->getSetter();
         $assembled = $property->getType()->assebmleSet($tuples, $this->strategy);
         foreach ($assembled as $k => $value) {
             $this->objects[$k]->{$setter}($value);
         }
     }
 }
 function __construct(ILogicallySchematic $logicalSchema)
 {
     $identifier = $logicalSchema->getIdentifier();
     if (!$identifier) {
         throw new OrmModelIntegrityException('IdentityMapOrmDao is for identifierable entities only');
     }
     if ($identifier->getVisibility()->isNot(OrmPropertyVisibility::FULL)) {
         throw new OrmModelIntegrityException('identifier property should have FULL access level');
     }
     $this->stubObject = $logicalSchema->getNewEntity();
     Assert::isTrue($this->stubObject instanceof IdentifiableOrmEntity, '%s should implement IdentifiableOrmEntity', $logicalSchema->getEntityName());
     $this->identifier = $identifier;
 }
Example #3
0
 function getBatchMapper()
 {
     if (!$this->logicalSchema->getIdentifier()) {
         return $this;
     }
     return new BatchOrmMap($this->logicalSchema, $this);
 }
Example #4
0
 function getPropertyList($property, ISqlSelectQuery $query = null)
 {
     $property = $this->logicalSchema->getProperty($property);
     $type = $property->getType();
     if (!$query) {
         $query = EntityQuery::create($this->entity)->get(Projection::property($property));
     }
     $rows = $this->getRows($query);
     $propertySet = $type->assebmleSet($rows, $this->getFetchStrategy());
     return $propertySet;
 }