protected function AppendOrderByExpressions(QueryBuilder $QueryBuilder, \SplObjectStorage $ExpressionAscendingMap) { $QueryBuilder->Append(' ORDER BY '); foreach ($QueryBuilder->Delimit($ExpressionAscendingMap, ', ') as $Expression) { $Ascending = $ExpressionAscendingMap[$Expression]; $Direction = $Ascending ? 'ASC' : 'DESC'; $QueryBuilder->AppendExpression($Expression); $QueryBuilder->Append(' ' . $Direction); } }
protected function UpdateQuery(QueryBuilder $QueryBuilder, Relational\Procedure $Procedure) { $TableNames = array_map(function ($Table) { return $Table->GetName(); }, $Procedure->GetTables()); $QueryBuilder->AppendIdentifiers('UPDATE # SET ', $TableNames, ','); foreach ($QueryBuilder->Delimit($Procedure->GetExpressions(), ',') as $Expression) { $QueryBuilder->AppendExpression($Expression); } $this->AppendCriterion($QueryBuilder, $Procedure->GetCriterion()); }
public function AppendDataAsInlineRow(QueryBuilder $QueryBuilder, array $Columns, Relational\ColumnData $ColumnData) { $QueryBuilder->Append(' SELECT '); foreach ($QueryBuilder->Delimit($Columns, ', ') as $Column) { $QueryBuilder->AppendExpression(Expression::PersistData($Column, Expression::Constant($ColumnData[$Column]))); } }