Storm\Core\Mapping\DomainDatabaseMap::MapPropetiesToRelationalRequest PHP Method

MapPropetiesToRelationalRequest() private method

private MapPropetiesToRelationalRequest ( Storm\Core\Mapping\IEntityRelationalMap $EntityRelationalMap, Request $RelationalRequest, array $Properties = null ) : void
$EntityRelationalMap Storm\Core\Mapping\IEntityRelationalMap The relational map of the entity
$RelationalRequest Storm\Core\Relational\Request The request to add to
$Properties array The array of properties to map or null if all properties should be mapped
return void
    private function MapPropetiesToRelationalRequest(IEntityRelationalMap $EntityRelationalMap, Relational\Request $RelationalRequest, array $Properties = null)
    {
        if ($Properties === null) {
            $Properties = $EntityRelationalMap->GetMappedProperties();
        }
        $DataPropertyColumnMappings = $EntityRelationalMap->GetDataPropertyColumnMappings();
        $EntityPropertyToOneRelationMappings = $EntityRelationalMap->GetEntityPropertyToOneRelationMappings();
        $CollectionPropertyToManyRelationMappings = $EntityRelationalMap->GetCollectionPropertyToManyRelationMappings();
        foreach ($Properties as $PropertyIdentifier => $Property) {
            if (isset($DataPropertyColumnMappings[$PropertyIdentifier])) {
                $RelationalRequest->AddColumns($DataPropertyColumnMappings[$PropertyIdentifier]->GetReviveColumns());
            } else {
                if (isset($EntityPropertyToOneRelationMappings[$PropertyIdentifier])) {
                    $EntityPropertyToOneRelationMappings[$PropertyIdentifier]->AddToRelationalRequest($this, $RelationalRequest);
                } else {
                    if (isset($CollectionPropertyToManyRelationMappings[$PropertyIdentifier])) {
                        $CollectionPropertyToManyRelationMappings[$PropertyIdentifier]->AddToRelationalRequest($this, $RelationalRequest);
                    }
                }
            }
        }
    }