AddTable() final public method

Add a table to the request.
final public AddTable ( Storm\Core\Relational\ITable $Table ) : void
$Table Storm\Core\Relational\ITable The table to add
return void
Esempio n. 1
0
 public final function AddRelationToRequest(Relational\Request $Request, array $ParentRows = null)
 {
     $Request->AddTable($this->Table);
     $this->AddConstraintToRequest($Request);
     if ($ParentRows !== null && count($ParentRows) > 0) {
         $this->AddParentPredicateToRequest($Request, $ParentRows);
     }
 }
Esempio n. 2
0
 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));
 }
Esempio n. 3
0
 public function AddConstraintToRequest(Relational\Request $Request)
 {
     $Request->AddTable($this->JoinTable);
     parent::AddConstraintToRequest($Request);
 }