Commit b8f18c3f authored by alexpott's avatar alexpott

Issue #2003500 by tyjamessmith, aviindub, marlatt: Rename Views method...

Issue #2003500 by tyjamessmith, aviindub, marlatt: Rename Views method get_value_options() to getValueOptions().
parent ee5a04c9
......@@ -19,7 +19,7 @@
*/
class NodeComment extends InOperator {
function get_value_options() {
public function getValueOptions() {
$this->value_options = array(
COMMENT_NODE_HIDDEN => t('Hidden'),
COMMENT_NODE_CLOSED => t('Closed'),
......
......@@ -19,7 +19,7 @@
*/
class FieldList extends ManyToOne {
function get_value_options() {
public function getValueOptions() {
$field = field_info_field($this->definition['field_name']);
$this->value_options = list_allowed_values($field);
}
......
......@@ -19,7 +19,7 @@
*/
class Status extends InOperator {
function get_value_options() {
public function getValueOptions() {
if (!isset($this->value_options)) {
$this->value_options = _views_file_status();
}
......
......@@ -19,7 +19,7 @@
*/
class LanguageFilter extends InOperator {
function get_value_options() {
public function getValueOptions() {
if (!isset($this->value_options)) {
$this->value_title = t('Language');
$languages = array(
......
......@@ -37,7 +37,7 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o
public function hasExtraOptions() { return TRUE; }
function get_value_options() { /* don't overwrite the value options */ }
public function getValueOptions() { /* don't overwrite the value options */ }
protected function defineOptions() {
$options = parent::defineOptions();
......
......@@ -146,7 +146,7 @@ function value_submit($form, &$form_state) {
}
// Override to do nothing.
function get_value_options() { }
public function getValueOptions() { }
public function adminSummary() {
// set up $this->value_options for the parent summary
......
......@@ -19,7 +19,7 @@
*/
class Permissions extends ManyToOne {
function get_value_options() {
public function getValueOptions() {
$module_info = system_get_info('module');
// Get a list of all the modules implementing a hook_permission() and sort by
......
......@@ -19,7 +19,7 @@
*/
class Roles extends ManyToOne {
function get_value_options() {
public function getValueOptions() {
$this->value_options = user_role_names(TRUE);
unset($this->value_options[DRUPAL_AUTHENTICATED_RID]);
}
......
......@@ -26,7 +26,7 @@ class MachineName extends FieldPluginBase {
*/
var $value_options;
function get_value_options() {
public function getValueOptions() {
if (isset($this->value_options)) {
return;
}
......@@ -63,7 +63,7 @@ public function buildOptionsForm(&$form, &$form_state) {
}
function pre_render(&$values) {
$this->get_value_options();
$this->getValueOptions();
}
function render($values) {
......
......@@ -69,7 +69,7 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o
* dynamic for some reason, child classes should use a guard to reduce
* database hits as much as possible.
*/
function get_value_options() {
public function getValueOptions() {
if (isset($this->definition['type'])) {
if ($this->definition['type'] == 'yes-no') {
$this->value_options = array(1 => t('Yes'), 0 => t('No'));
......@@ -103,7 +103,7 @@ function operator_form(&$form, &$form_state) {
function value_form(&$form, &$form_state) {
if (empty($this->value_options)) {
// Initialize the array of possible values for this filter.
$this->get_value_options();
$this->getValueOptions();
}
if (!empty($form_state['exposed'])) {
// Exposed filter: use a select box to save space.
......@@ -149,7 +149,7 @@ public function adminSummary() {
return t('exposed');
}
if (empty($this->value_options)) {
$this->get_value_options();
$this->getValueOptions();
}
// Now that we have the valid options for this filter, just return the
// human-readable label based on the current value. The value_options
......
......@@ -46,9 +46,9 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o
}
/**
* Overrides \Drupal\views\Plugin\views\filter\InOperator::get_value_options().
* Overrides \Drupal\views\Plugin\views\filter\InOperator::getValueOptions().
*/
public function get_value_options() {
public function getValueOptions() {
if (!isset($this->value_options)) {
$types = entity_get_bundles($this->entityType);
$this->value_title = t('@entity types', array('@entity' => $this->entityInfo['label']));
......
......@@ -53,7 +53,7 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o
* @return
* Return the stored values in $this->value_options if someone expects it.
*/
function get_value_options() {
public function getValueOptions() {
if (isset($this->value_options)) {
return;
}
......@@ -173,7 +173,7 @@ function value_form(&$form, &$form_state) {
$options = array('all' => t('Select all'));
}
$this->get_value_options();
$this->getValueOptions();
$options += $this->value_options;
$default_value = (array) $this->value;
......@@ -316,7 +316,7 @@ public function adminSummary() {
}
$info = $this->operators();
$this->get_value_options();
$this->getValueOptions();
if (!is_array($this->value)) {
return;
......@@ -400,7 +400,7 @@ function op_empty() {
}
public function validate() {
$this->get_value_options();
$this->getValueOptions();
$errors = array();
// If the operator is an operator which doesn't require a value, there is
......
......@@ -93,7 +93,7 @@ public function testFilterEntity() {
foreach ($this->entityBundles as $key => $info) {
$expected[$key] = $info['label'];
}
$this->assertIdentical($view->filter['type']->get_value_options(), $expected);
$this->assertIdentical($view->filter['type']->getValueOptions(), $expected);
$view->destroy();
......
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