You are here

public function EntityFieldQueryExtraFields::addExtraField in EntityFieldQuery Extra Fields 7

Add the given field with an INNER JOIN and add a select statement for the requested field

_alias

Parameters

type $field_name:

type $column:

type $table:

Return value

\EntityFieldQueryExtraFields

File

./efq_extra_field.module, line 128

Class

EntityFieldQueryExtraFields

Code

public function addExtraField($field_name, $column, $column_alias = NULL, $table = NULL) {
  if (!empty($field_name) && !$this
    ->checkFieldExists($field_name)) {

    // Add the field as a condition, so we generate the join
    $this
      ->fieldCondition($field_name);
  }
  $this->addedFields[] = array(
    'field_name' => $field_name,
    'column' => $column,
    'column_alias' => $column_alias,
    'table' => $table,
  );
  return $this;
}