Commit 16c85cea authored by alexpott's avatar alexpott

Issue #2002916 by sillygwailo: Rename Views method get_formula() to getFormula().

parent 19addd35
......@@ -46,11 +46,11 @@ public function buildOptionsForm(&$form, &$form_state) {
/**
* 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->get_formula();
* and implement handler->getFormula();
*/
public function getField() {
if (!empty($this->formula)) {
return $this->handler->get_formula();
return $this->handler->getFormula();
}
else {
return $this->handler->tableAlias . '.' . $this->handler->realField;
......
......@@ -174,7 +174,7 @@ public function adminLabel($short = FALSE) {
public function getField($field = NULL) {
if (!isset($field)) {
if (!empty($this->formula)) {
$field = $this->get_formula();
$field = $this->getFormula();
}
else {
$field = $this->tableAlias . '.' . $this->realField;
......
......@@ -95,11 +95,11 @@ public function getSortName() {
}
/**
* Overrides \Drupal\views\Plugin\views\argument\Formula::get_formula().
* Overrides \Drupal\views\Plugin\views\argument\Formula::getFormula().
*/
function get_formula() {
public function getFormula() {
$this->formula = $this->getDateFormat($this->argFormat);
return parent::get_formula();
return parent::getFormula();
}
}
......@@ -38,7 +38,7 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o
}
}
function get_formula() {
public function getFormula() {
return str_replace('***table***', $this->tableAlias, $this->formula);
}
......@@ -48,7 +48,7 @@ function get_formula() {
function summary_query() {
$this->ensureMyTable();
// Now that our table is secure, get our formula.
$formula = $this->get_formula();
$formula = $this->getFormula();
// Add the field.
$this->base_alias = $this->name_alias = $this->query->add_field(NULL, $formula, $this->field);
......@@ -64,7 +64,7 @@ public function query($group_by = FALSE) {
$this->ensureMyTable();
// Now that our table is secure, get our formula.
$placeholder = $this->placeholder();
$formula = $this->get_formula() .' = ' . $placeholder;
$formula = $this->getFormula() .' = ' . $placeholder;
$placeholders = array(
$placeholder => $this->argument,
);
......
......@@ -161,7 +161,7 @@ function summary_query() {
}
else {
// Add the field.
$formula = $this->get_formula();
$formula = $this->getFormula();
$this->base_alias = $this->query->add_field(NULL, $formula, $this->field . '_truncated');
$this->query->set_count_field(NULL, $formula, $this->field, $this->field . '_truncated');
}
......@@ -175,7 +175,7 @@ function summary_query() {
*
* $this->ensureMyTable() MUST have been called prior to this.
*/
function get_formula() {
public function getFormula() {
return "SUBSTRING($this->tableAlias.$this->realField, 1, " . intval($this->options['limit']) . ")";
}
......@@ -212,7 +212,7 @@ public function query($group_by = FALSE) {
}
else {
$formula = TRUE;
$field = $this->get_formula();
$field = $this->getFormula();
}
if (count($this->value) > 1) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment