public function AddParentPredicateToRequest(Relational\Request $Request, array $ParentRows) { if (count($ParentRows) > 1) { $Request->AddColumns($this->ParentForeignKey->GetParentColumns()); } parent::AddParentPredicateToRequest($Request, $ParentRows); }
public function AddParentPredicateToRequest(Relational\Request $Request, array $ParentRows) { $ParentTable = $this->GetParentTable(); if ($ParentTable) { $Request->AddTable($ParentTable); } $Request->AddColumns($this->GetReferencedColumns()); $MatchExpressions = []; foreach ($ParentRows as $ParentRow) { $ReferencedKey = $this->MapParentRowToRelatedKey($this->ForeignKey, $ParentRow); $MatchExpressions[] = new Expressions\MatchesColumnDataExpression($ReferencedKey); } $Request->GetCriterion()->AddPredicateExpression(Expressions\Expression::CompoundBoolean($MatchExpressions, Expressions\Operators\Binary::LogicalOr)); }
/** * @access private * * Maps the supplied properties such that they will be loaded in the given relational request. * * @param \Storm\Core\Mapping\IEntityRelationalMap $EntityRelationalMap The relational map of the entity * @param \Storm\Core\Relational\Request $RelationalRequest The request to add to * @param array|null $Properties 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); } } } } }
public final function AddToRelationalRequest(DomainDatabaseMap $DomainDatabaseMap, Relational\Request $RelationalRequest) { $RelationalRequest->AddColumns($this->Relation->GetRelationalParentColumns()); }