Issue #2002974 by tvlooy, kenianbei, danylevskyi | Dan Reinders: Rename Views method title_query() to titleQuery().
parent
490b88f285
commit
cbc907fa79
|
@ -20,9 +20,9 @@ use Drupal\views\Plugin\views\argument\Numeric;
|
||||||
class Fid extends Numeric {
|
class Fid extends Numeric {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Override the behavior of title_query(). Get the filenames.
|
* Override the behavior of titleQuery(). Get the filenames.
|
||||||
*/
|
*/
|
||||||
function title_query() {
|
public function titleQuery() {
|
||||||
$titles = db_select('file_managed', 'f')
|
$titles = db_select('file_managed', 'f')
|
||||||
->fields('f', array('filename'))
|
->fields('f', array('filename'))
|
||||||
->condition('fid', $this->value)
|
->condition('fid', $this->value)
|
||||||
|
|
|
@ -20,7 +20,7 @@ class Nid extends Numeric {
|
||||||
/**
|
/**
|
||||||
* Override the behavior of title(). Get the title of the node.
|
* Override the behavior of title(). Get the title of the node.
|
||||||
*/
|
*/
|
||||||
function title_query() {
|
public function titleQuery() {
|
||||||
$titles = array();
|
$titles = array();
|
||||||
|
|
||||||
$nodes = node_load_multiple($this->value);
|
$nodes = node_load_multiple($this->value);
|
||||||
|
|
|
@ -22,7 +22,7 @@ class Vid extends Numeric {
|
||||||
/**
|
/**
|
||||||
* Override the behavior of title(). Get the title of the revision.
|
* Override the behavior of title(). Get the title of the revision.
|
||||||
*/
|
*/
|
||||||
function title_query() {
|
public function titleQuery() {
|
||||||
$titles = array();
|
$titles = array();
|
||||||
|
|
||||||
$results = db_select('node_field_revision', 'npr')
|
$results = db_select('node_field_revision', 'npr')
|
||||||
|
|
|
@ -43,7 +43,7 @@ class IndexTid extends ManyToOne {
|
||||||
return views_taxonomy_set_breadcrumb($breadcrumb, $this);
|
return views_taxonomy_set_breadcrumb($breadcrumb, $this);
|
||||||
}
|
}
|
||||||
|
|
||||||
function title_query() {
|
public function titleQuery() {
|
||||||
$titles = array();
|
$titles = array();
|
||||||
$result = db_select('taxonomy_term_data', 'td')
|
$result = db_select('taxonomy_term_data', 'td')
|
||||||
->fields('td', array('name'))
|
->fields('td', array('name'))
|
||||||
|
|
|
@ -19,7 +19,7 @@ use Drupal\views\Plugin\views\argument\ManyToOne;
|
||||||
*/
|
*/
|
||||||
class RolesRid extends ManyToOne {
|
class RolesRid extends ManyToOne {
|
||||||
|
|
||||||
function title_query() {
|
public function titleQuery() {
|
||||||
return array(entity_load('user_role', $this->value)->label());
|
return array(entity_load('user_role', $this->value)->label());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ class Uid extends Numeric {
|
||||||
* @return array
|
* @return array
|
||||||
* A list of usernames.
|
* A list of usernames.
|
||||||
*/
|
*/
|
||||||
function title_query() {
|
public function titleQuery() {
|
||||||
if (!$this->argument) {
|
if (!$this->argument) {
|
||||||
return array(config('user.settings')->get('anonymous'));
|
return array(config('user.settings')->get('anonymous'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,7 +158,7 @@ class ManyToOne extends ArgumentPluginBase {
|
||||||
return !empty($this->definition['invalid input']) ? $this->definition['invalid input'] : t('Invalid input');
|
return !empty($this->definition['invalid input']) ? $this->definition['invalid input'] : t('Invalid input');
|
||||||
}
|
}
|
||||||
|
|
||||||
return implode($this->operator == 'or' ? ' + ' : ', ', $this->title_query());
|
return implode($this->operator == 'or' ? ' + ' : ', ', $this->titleQuery());
|
||||||
}
|
}
|
||||||
|
|
||||||
function summary_query() {
|
function summary_query() {
|
||||||
|
@ -196,7 +196,7 @@ class ManyToOne extends ArgumentPluginBase {
|
||||||
/**
|
/**
|
||||||
* Override for specific title lookups.
|
* Override for specific title lookups.
|
||||||
*/
|
*/
|
||||||
function title_query() {
|
public function titleQuery() {
|
||||||
return $this->value;
|
return $this->value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,7 @@ class Numeric extends ArgumentPluginBase {
|
||||||
return !empty($this->definition['invalid input']) ? $this->definition['invalid input'] : t('Invalid input');
|
return !empty($this->definition['invalid input']) ? $this->definition['invalid input'] : t('Invalid input');
|
||||||
}
|
}
|
||||||
|
|
||||||
return implode($this->operator == 'or' ? ' + ' : ', ', $this->title_query());
|
return implode($this->operator == 'or' ? ' + ' : ', ', $this->titleQuery());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -90,7 +90,7 @@ class Numeric extends ArgumentPluginBase {
|
||||||
* @return array
|
* @return array
|
||||||
* Returns all titles, if it's just one title it's an array with one entry.
|
* Returns all titles, if it's just one title it's an array with one entry.
|
||||||
*/
|
*/
|
||||||
function title_query() {
|
public function titleQuery() {
|
||||||
return $this->value;
|
return $this->value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -278,13 +278,13 @@ class String extends ArgumentPluginBase {
|
||||||
return !empty($this->definition['invalid input']) ? $this->definition['invalid input'] : t('Invalid input');
|
return !empty($this->definition['invalid input']) ? $this->definition['invalid input'] : t('Invalid input');
|
||||||
}
|
}
|
||||||
|
|
||||||
return implode($this->operator == 'or' ? ' + ' : ', ', $this->title_query());
|
return implode($this->operator == 'or' ? ' + ' : ', ', $this->titleQuery());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Override for specific title lookups.
|
* Override for specific title lookups.
|
||||||
*/
|
*/
|
||||||
function title_query() {
|
public function titleQuery() {
|
||||||
return drupal_map_assoc($this->value, 'check_plain');
|
return drupal_map_assoc($this->value, 'check_plain');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue