function ManyToOneHelper::getField

Same name in other branches
  1. 9 core/modules/views/src/ManyToOneHelper.php \Drupal\views\ManyToOneHelper::getField()
  2. 8.9.x core/modules/views/src/ManyToOneHelper.php \Drupal\views\ManyToOneHelper::getField()
  3. 11.x core/modules/views/src/ManyToOneHelper.php \Drupal\views\ManyToOneHelper::getField()

Get the field via formula or build it using alias and field name.

Sometimes the handler might want us to use some kind of formula, so give it that option. If it wants us to do this, it must set $helper->formula = TRUE and implement handler->getFormula().

1 call to ManyToOneHelper::getField()
ManyToOneHelper::addFilter in core/modules/views/src/ManyToOneHelper.php

File

core/modules/views/src/ManyToOneHelper.php, line 63

Class

ManyToOneHelper
This many to one helper object is used on both arguments and filters.

Namespace

Drupal\views

Code

public function getField() {
    if (!empty($this->formula)) {
        return $this->handler
            ->getFormula();
    }
    else {
        return $this->handler->tableAlias . '.' . $this->handler->realField;
    }
}

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