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);
}
}
}
}
}