function TablesInterface::addField

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/Query/Sql/TablesInterface.php \Drupal\Core\Entity\Query\Sql\TablesInterface::addField()
  2. 8.9.x core/lib/Drupal/Core/Entity/Query/Sql/TablesInterface.php \Drupal\Core\Entity\Query\Sql\TablesInterface::addField()
  3. 11.x core/lib/Drupal/Core/Entity/Query/Sql/TablesInterface.php \Drupal\Core\Entity\Query\Sql\TablesInterface::addField()

Adds a field to a database query.

Parameters

string $field: The field to add to the query.

For comprehensive documentation on the format, see \Drupal\Core\Entity\Query\QueryInterface::condition().

string $type: Join type, can either be INNER or LEFT.

string $langcode: The language code the field values are to be queried in.

Return value

string The return value is a string containing the alias of the table, a dot and the appropriate SQL column as passed in. This allows the direct use of this in a query for a condition or sort.

Throws

\Drupal\Core\Entity\Query\QueryException If $field specifies an invalid relationship.

1 method overrides TablesInterface::addField()
Tables::addField in core/lib/Drupal/Core/Entity/Query/Sql/Tables.php
Adds a field to a database query.

File

core/lib/Drupal/Core/Entity/Query/Sql/TablesInterface.php, line 31

Class

TablesInterface
Adds tables and fields to the SQL entity query.

Namespace

Drupal\Core\Entity\Query\Sql

Code

public function addField($field, $type, $langcode);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.