public function TablesInterface::addField

public TablesInterface::addField($field, $type, $langcode)

Adds a field to a database query.

Parameters

string $field: If it doesn't contain a dot, then an entity base field name. If it contains a dot, then either field name dot field column or field name dot delta dot field column. Delta can be a numeric value or a "%delta" for any value.

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.

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);

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!Query!Sql!TablesInterface.php/function/TablesInterface::addField/8.1.x