Map field value to a proper search engine representation.

@param \eZ\Publish\SPI\Search\Field $field

@return mixed
972844
public function map(Field $field)
    {
        if (is_numeric($field->value)) {
            $date = new DateTime("@{$field->value}");
        } else {
            try {
                $date = new DateTime($field->value);
            } catch (Exception $e) {
                throw new InvalidArgumentException('Invalid date provided: ' . $field->value);
            }
        }

        return $date->format('Y-m-d\\TH:i:s\\Z');
    }
1006640
public function getFieldData(Field $field)
    {
        if ($field->value->data === null) {
            return;
        }

        $doc = new DOMDocument();
        if (!$doc->loadXML($field->value->data)) {
            return;
        }

        $linkTags = $doc->getElementsByTagName('link');

        if ($linkTags->length > 0) {
            $links = [];

            foreach ($linkTags as $link) {
                $urlId = $link->getAttribute('url_id');
                if (!empty($urlId)) {
                    if (!isset($links[$urlId])) {
                        $links[$urlId] = [];
                    }
                    $links[$urlId][] = $link;
                }
            }

            if (!empty($links)) {
                $linkIdUrlMap = $this->getIdUrlMap(array_keys($links));

                foreach ($linkIdUrlMap as $urlId => $url) {
                    foreach ($links[$urlId] as $link) {
                        $link->setAttribute('url', $url);
                        $link->removeAttribute('url_id');
                    }
                }

                // Store xml changes back to field
                $field->value->data = $doc->saveXML();
            }
        }
    }
486851
public function get_field_raw( $field ) {
		if ( array_key_exists( $field, $this->prop( 'fields' ) ) ) {
			return $this->prop( 'fields' )[ $field ];
		}

		return null;
	}
1032848
public function get($field)
    {
        if ($this->definition->getField($field, 'value') !== null) {
            return $this->definition->getField($field, 'value');
        }

        if (!array_key_exists($field, $this->entity)) {
            return null;
        }

        $type  = $this->definition->getType($field);
        $value = $this->toType($this->entity[$field], $type);
        return $value;
    }
562226
protected function getField($field)
    {
        if ($this->isFieldSupported($field) && isset($this->fields[ $field ])) {
            return $this->fields[ $field ];
        }

        return null;
    }
664179
public function fieldQuery($field)
    {
        $query = $this->dsql()->del('fields');
        if (is_string($field)) {
            $field = $this->getElement($field);
        }
        $field->updateSelectQuery($query);

        return $query;
    }
1246244
protected function key($field)
    {
        if (method_exists($this->model, 'getTrueKey')) {
            return $this->model->getTrueKey($field);
        }

        return $field;
    }
1339932
public function getField(string $field) : string
        {
                $value = $this->_redis->hget($this->_key, $field);
                return empty($value) ? '' : strval($value);
        }
346017
public function fieldValue($field, $value)
    {
        if (!in_array($field, $this->supports)) {
            $this->supports[ ] = $field;
        }
        $this->values[ $field ] = $value;

        return $this;
    }
742071
private function getJqFilterField($field)
    {
        if (!isset($this->jqFilterFields) || !is_array($this->jqFilterFields)) {
            $this->jqFilterFields = $this->jqSearchable;
        }

        if (!isset($this->jqFilterFields) || !is_array($this->jqFilterFields)) {
            return $field;
        }

        return isset($this->jqFilterFields[$field]) ? $this->jqFilterFields[$field] : $field;
    }
1346953
public function value($field) {
        $this->fields = [];
        $this->order("");
        $this->fields($field);
        $this->limit(0, 1);
        $connection = Pool::get(Connection::class);
        try {
            $value = $connection->value($this->getSql(), $this->whereParams(), $this->cache);
            Pool::release($connection);
            return $value;
        } catch (\RuntimeException $e) {
            Pool::release($connection);
            throw $e;
        } catch (\Error $e) {
            Pool::release($connection);
            throw $e;
        }
    }
916644
protected function getHeaderFieldModel($field)
    {
        if ($this->headers->has($field)) {
            return $this->headers->get($field)->getFieldBodyModel();
        }
    }
472686
final public function getRowFieldValue($field)
    {

        //If value exists;
        if (array_key_exists($field, $this->schema)) {
            return $this->schema[$field]->Value;
        }
        return null;
    }
82180
public function whereInset($field, $value)
    {
        $key = strtr($field, '.', '_');
        $this->_conditions[] = 'FIND_IN_SET(:' . $key . ', ' . '[' . str_replace('.', '].[', $field) . '])>0';
        $this->_bind[$key] = $value;

        return $this;
    }
847705
private function buildPrefix(Field $field)
    {
        $prefix = $field->get('prefix');

        if (! is_null($prefix)) {
            foreach (array_filter(explode(' ', $prefix)) as $name) {
                $prefix .= '['.$name.']';
            }

            return $prefix;
        }

        return $this->prefix;
    }
605387
public function url($field)
    {
        return (filter_var(trim($this->get($field)), FILTER_VALIDATE_URL) !== false) ?: $this->error($field,
            __FUNCTION__);
    }
830316
public function values($field)
    {
        $values = [];
        foreach ($this->queries as $query) {
            $t = $query->values($field);
            /** @noinspection SlowArrayOperationsInLoopInspection */
            $values = array_merge($values, $t);
        }

        return array_values(array_unique($values, SORT_REGULAR));
    }