Commit de9f13c1 authored by catch's avatar catch
Browse files

Issue #2062131 by danylevskyi, NonProfit: In MachineName Class Rename Views...

Issue #2062131 by danylevskyi, NonProfit: In MachineName Class Rename Views properties to core standards.
parent 928a366d
...@@ -25,23 +25,23 @@ class MachineName extends FieldPluginBase { ...@@ -25,23 +25,23 @@ class MachineName extends FieldPluginBase {
/** /**
* @var array Stores the available options. * @var array Stores the available options.
*/ */
var $value_options; protected $valueOptions;
public function getValueOptions() { public function getValueOptions() {
if (isset($this->value_options)) { if (isset($this->valueOptions)) {
return; return;
} }
if (isset($this->definition['options callback']) && is_callable($this->definition['options callback'])) { if (isset($this->definition['options callback']) && is_callable($this->definition['options callback'])) {
if (isset($this->definition['options arguments']) && is_array($this->definition['options arguments'])) { if (isset($this->definition['options arguments']) && is_array($this->definition['options arguments'])) {
$this->value_options = call_user_func_array($this->definition['options callback'], $this->definition['options arguments']); $this->valueOptions = call_user_func_array($this->definition['options callback'], $this->definition['options arguments']);
} }
else { else {
$this->value_options = call_user_func($this->definition['options callback']); $this->valueOptions = call_user_func($this->definition['options callback']);
} }
} }
else { else {
$this->value_options = array(); $this->valueOptions = array();
} }
} }
...@@ -72,11 +72,11 @@ public function preRender(&$values) { ...@@ -72,11 +72,11 @@ public function preRender(&$values) {
*/ */
public function render(ResultRow $values) { public function render(ResultRow $values) {
$value = $values->{$this->field_alias}; $value = $values->{$this->field_alias};
if (!empty($this->options['machine_name']) || !isset($this->value_options[$value])) { if (!empty($this->options['machine_name']) || !isset($this->valueOptions[$value])) {
$result = check_plain($value); $result = check_plain($value);
} }
else { else {
$result = $this->value_options[$value]; $result = $this->valueOptions[$value];
} }
return $result; return $result;
......
Supports Markdown
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