You are here

public function Select::addExpression in Drupal driver for SQL Server and SQL Azure 8.2

Same name and namespace in other branches
  1. 8 drivers/lib/Drupal/Driver/Database/sqlsrv/Select.php \Drupal\Driver\Database\sqlsrv\Select::addExpression()
  2. 3.0.x drivers/lib/Drupal/Driver/Database/sqlsrv/Select.php \Drupal\Driver\Database\sqlsrv\Select::addExpression()

Overriden with an aditional exclude parameter that tells not to include this expression (by default) in the select list.

Parameters

string $expression:

string $alias:

string $arguments:

string $exclude: If set to TRUE, this expression will not be added to the select list. Useful when you want to reuse expressions in the WHERE part.

string $expand: If this expression will be expanded as a CROSS_JOIN so it can be consumed from other parts of the query. TRUE by default. It attempts to detect expressions that cannot be cross joined (aggregates).

Return value

string

Overrides Select::addExpression

2 calls to Select::addExpression()
Select::orderRandom in drivers/lib/Drupal/Driver/Database/sqlsrv/Select.php
Override of SelectQuery::orderRandom() for SQL Server.
Select::preExecute in drivers/lib/Drupal/Driver/Database/sqlsrv/Select.php
Override for SelectQuery::preExecute().

File

drivers/lib/Drupal/Driver/Database/sqlsrv/Select.php, line 43
Definition of Drupal\Driver\Database\sqlsrv\Select

Class

Select

Namespace

Drupal\Driver\Database\sqlsrv

Code

public function addExpression($expression, $alias = null, $arguments = [], $exclude = false, $expand = true) {
  $alias = parent::addExpression($expression, $alias, $arguments);
  $this->expressions[$alias]['exclude'] = $exclude;
  $this->expressions[$alias]['expand'] = $expand;
  return $alias;
}