Return the value for this field.
This will return an array if the field
is setup as "multiple". Otherwise it will return a string with the selected value.

@return array|string
6371
public function getValue()
    {
        $selected = [];

        // walk all options
        foreach ($this->options as $option) {
            if ($option instanceof Option) {
                if ($option->isSelected()) {
                    $selected[] = $option->getValue();
                }
            } else {
                if ($option instanceof Optgroup) {
                    $options = $option->getOptions();
                    foreach ($options as $option2) {
                        if ($option2->isSelected()) {
                            $selected[] = $option2->getValue();
                        }
                    }
                }
            }
        }

        $count = sizeof($selected);
        if ($count > 0) {
            if ($this->isMultiple()) {
                return $selected;
            } else {
                // return last selected item as value
                return $selected[$count - 1];
            }
        }

        return $this->isMultiple() ? [] : "";
    }
317488
private function getValuesAsArray()
    {
        if ($this->value === null) {
            return is_array($this->defaultValue) 
                ? $this->defaultValue 
                : [ $this->defaultValue ];
        }
        return $this->value;
    }
898734
public function getSelect()
    {
        if (null === $this->_select) {
            $db = $this->getAdapter();
            /**
             * Build select object
             */
            $select = new Zend_Db_Select($db);
            $select->from($this->_table, array($this->_field), $this->_schema);
            if ($db->supportsParameters('named')) {
                $select->where($db->quoteIdentifier($this->_field, true).' = :value'); // named
            } else {
                $select->where($db->quoteIdentifier($this->_field, true).' = ?'); // positional
            }
            if ($this->_exclude !== null) {
                if (is_array($this->_exclude)) {
                    $select->where(
                          $db->quoteIdentifier($this->_exclude['field'], true) .
                            ' != ?', $this->_exclude['value']
                    );
                } else {
                    $select->where($this->_exclude);
                }
            }
            $select->limit(1);
            $this->_select = $select;
        }
        return $this->_select;
    }
914042
public function field()
    {
        $yesOption = '<option value="1"'.($this->value === 1 ? ' selected="selected"' : null).'>'.
            trans('panel::global.yes').'</option>';
        $noOption = '<option value="0"'.($this->value === 0 ? ' selected="selected"' : null).'>'.
            trans('panel::global.no').'</option>';

        $input = new HTMLBrick('select', $yesOption.$noOption, [
            'id'   => $this->id,
            'name' => $this->name,
        ]);
        $input->addClass('form-control');

        return $input;
    }
827918
public function get_field_select() : string {
        $fieldlist = $this->get_fieldlist();

        return implode(', ', array_map(function($fieldname, $fieldalias) {
            return "{$this->tablealias}.{$fieldname} AS {$fieldalias}";
        }, $fieldlist, array_keys($fieldlist)));
    }
76310
public function getValue() {
		$value = array();
		foreach ($this->decorated->getValue() as $key => $decoratedFieldValue) {
			if (array_key_exists(self::PROPERTY_NAME, $decoratedFieldValue)) {
				$value[$key] = $decoratedFieldValue[self::PROPERTY_NAME];
			}
		}
		return $value;
	}
1270762
public final function getOrgValue() {
		if ($this->orgValueLoaded) {
			return $this->orgValue;
		}

		$this->orgValue = $this->readValue();
		$this->orgValueLoaded = true;
		return $this->orgValue;
	}
441283
private function getValueFromField()
    {
        $position = $this->readUntil($this->boundary);

        # there is always a newline after the value and before the boundary
        # exclude that newline from the value
        $value = substr($this->buffer, 0, $position - 2);

        # update the buffer to exclude the value and the pre boundary newline
        $this->buffer = substr($this->buffer, $position);

        return $value;
    }
775360
public function getAsArray(): array
    {
        $result = array();

        foreach ($this->_definition as $key => $def) {
            $result[$key] = $this->getFieldAsArray($key);
        }

        return $result;
    }
580316
public function getValue()
    {
        $parts = $this->literalParts;
        
        reset($this->encodedParts);
        ksort($this->encodedParts);
        while (current($this->encodedParts) !== false) {
            $parts[key($this->encodedParts)] = $this->getNextEncodedValue();
        }
        
        ksort($parts);
        return array_reduce(
            $parts,
            function ($carry, $item) {
                return $carry . $item;
            },
            ''
        );
    }
44419
public function getField()
    {
        $value = $this->name;
        if (null != $this->field) {
            $value = $this->field;
        }
        return $value;
    }
486843
public function getValue()
    {
        if (is_array($this->value)) {
            if (0 == count($this->value)) {
                return;
            } elseif (1 === count($this->value)) {
                return $this->value[0];
            } else {
                return $this->getRawMimeDirValue();
            }
        } else {
            return $this->value;
        }
    }
235764
public function getValue()
    {
        $terms = $this->base['value'];

        if (is_array($terms)) {
            $ret = array();

            foreach ($terms as $t) {
                $ret[] = $this->termFactory->create($t, $this->taxonomy());
            }

            return $ret;
        } elseif (is_object($terms)) {
            return $this->termFactory->create($terms, $this->taxonomy());
        } else {
            if ($this->base['multiple'] || $this->base['field_type'] === 'multi_select' || $this->base['field_type'] === 'checkbox') {
                return array();
            } else {
                return null;
            }
        }
    }
741682
public function dataValue()
    {
        $result = null;
        if (is_array($this->value)) {
            $this->value = $this->arrayFilterEmptyRecursive($this->value);
            $result = (!empty($this->value)) ? Convert::array2json($this->value) : $result;
        } else {
            $result = parent::dataValue();
        }

        return $result;
    }
265760
public function getSelect()
    {
        $concat = null;

        foreach ($this->fieldDescriptors as $fieldDescriptor) {
            if (null == $concat) {
                $concat = $fieldDescriptor->getSelect();
            } else {
                $concat = 'CONCAT(' . $concat . ', CONCAT(\'' . $this->glue . '\', ' . $fieldDescriptor->getSelect() . '))';
            }
        }

        return $concat;
    }
422531
public function getValue()
    {
        $out = [];
        foreach ($this->value as $key => $value) {
            $out[] = $key.'='.(is_array($value) ? implode(',', $value) : $value);
        }

        return strtoupper(implode(';', $out));
    }
628266
public function field()
    {
        if (strpos($this->wrappedObject->key, '_id')) {
            return str_replace('_id', '', $this->wrappedObject->key);
        }

        return $this->wrappedObject->key;
    }