Parses content string as directed

@param   string  $field  The field to parse
@param   string  $as     The format to return state in
@return  string
@since   2.0.0
775943
public function parse($field, $as = 'parsed')
	{
		switch (strtolower($as))
		{
			case 'parsed':
				$property = "_{$field}Parsed";

				if (!isset($this->$property))
				{
					$this->$property = Html::content('prepare', $this->get($field, ''));
				}

				return $this->$property;
			break;

			case 'raw':
			default:
				$content = stripslashes($this->get($field, ''));
				return preg_replace('/^(<!-- \{FORMAT:.*\} -->)/i', '', $content);
			break;
		}
	}
274116
public function getField($field)
    {
        if (!$this->isFieldSupported($field)) {
            return null;
        }

        if (!$this->hasLoadedField($field)) {
            $loaderData = $this->getLoaderData($field);
            if ($normalizer = $this->normalizersMap->getNormalizerForField($field)) {
                switch ($normalizer[ 'type' ]) {
                    case NormalizersMap::TYPE_METHOD:
                        $this->fields[ $field ] =
                            $this->{sprintf('%sNormalizer', $normalizer[ 'method' ])}($loaderData);
                        break;

                    case NormalizersMap::TYPE_ARRAY_PATH:
                        $this->fields[ $field ] =
                            ArrayUtils::getNested($loaderData, $normalizer[ 'path' ], $normalizer[ 'defaultValue' ]);
                        break;

                    case NormalizersMap::TYPE_PREFILLED_VALUE:
                        $this->fields[ $field ] = $normalizer[ 'value' ];
                        break;

                    default:
                        throw new GenericException("Unknown normalizer type \"{$normalizer['type']}\"");
                }

                switch ($field) {
                    case self::FIELD_WEBSITES:
                    case self::FIELD_EXTRA:
                        if ($this->fields[ $field ]) {
                            $this->fields[ $field ] = (array) $this->fields[ $field ];
                        } else {
                            $this->fields[ $field ] = [];
                        }
                        break;
                }
            } // Don't need to be normalized
            else {
                $this->fields[ $field ] = $loaderData;
            }
        }

        return parent::getField($field);
    }
330322
public function getContent(string $field, $locale = null)
    {
        return $this->getBaseContent($field) ?? $this->getContentMultiLang($field, $locale);
    }
795370
public function from($field, string $as): self
    {
        if (is_string($field) && strpos($field, '(') === false) {
            $field = $this->prepareField($field);
        }

        $this->query['from'] = sprintf('(%s) AS %s', $field, $this->agent->quoteField($as));

        return $this;
    }
1176045
final public function imageAsString($as = null)
	{
		$image = $this->imageAsDOMElement($as);
		return $image->ownerDocument->saveHTML($image);
	}
75621
public function orderBy($field, $direction = 1)
    {
        if (is_string($direction)) {
            $direction = $direction === 'asc' ? 1 : -1;
        }

        $this->orderBy[$field] = $direction;

        return $this;
    }
1247878
public function field(string $field, string $as = null): Select
    {
        $this->fields[] = [
          'name' => $field,
          'as' => $as
        ];

        return $this;
    }
417698
protected function parseFieldForSelect($field)
    {
        if ($function = $field->getDbFunction(DbFunctionUses::SELECT)) {
            return $this->parent->getConnection()->raw($function . ' AS ' . $field->getName(true, true));
        }

        $out = $field->name;
        if (!empty($field->alias)) {
            $out .= ' AS ' . $field->alias;
        }

        return $out;
    }
1107797
protected function field(array $field)
    {
        if (!empty($field['fields'])) {
            $result = $this->fieldset($field);
        } else {
            $result = $this->element($field);
        }
        return $result;
    }
645935
private function parseSegments($field)
    {
        $segments = explode(':', $field);

        $name = array_shift($segments);
        $argument = $segments[0];

        return compact('name', 'argument');

    }
763041
public function selectMore($field, string $as = null): self
    {
        return $this->select($field, $as, false);
    }
1339932
public function getField(string $field) : string
        {
                $value = $this->_redis->hget($this->_key, $field);
                return empty($value) ? '' : strval($value);
        }
874430
private function getFullTextFieldValue(Content\Field $field, Type\FieldDefinition $fieldDefinition)
    {
        $fieldType = $this->fieldRegistry->getType($field->type);
        $indexFields = $fieldType->getIndexData($field, $fieldDefinition);

        // find value to be returned (stored in FullTextField)
        $fullTextFieldValue = '';
        foreach ($indexFields as $field) {
            /** @var \eZ\Publish\SPI\Search\Field $field */
            if ($field->type instanceof FieldType\FullTextField) {
                $fullTextFieldValue = $field->value;
                break;
            }
        }

        // some full text fields are stored as an array of strings
        return !is_array($fullTextFieldValue) ? $fullTextFieldValue : implode(' ', $fullTextFieldValue);
    }
689517
protected function textarea(array $field)
    {
        $output = '';

        // Tag around input element.
        $output .= $this->getWrapper('input');
        $attributes = $field['attributes'];
        $attributes = $this->addAttribute($attributes, 'id', $field['id']);
        $attributes = $this->addAttribute($attributes, 'name', $field['name']);
        $output .= $this->getOpenTag('textarea', $attributes);
        $output .= htmlspecialchars($field['value'], $this->htmlSpecialCharsFlag, 'UTF-8');
        $output .= $this->getCloseTag('textarea');

        // Tag around input element.
        $output .= $this->getWrapperEnd('input');

        return $output;
    }
651340
private function parsePreferences($serverField, $field, $fromField)
    {
        $tokenList = $this->tokenizer->tokenize($field, $fromField);

        return $this->parser->parse($tokenList, $serverField, $fromField);
    }
605387
public function url($field)
    {
        return (filter_var(trim($this->get($field)), FILTER_VALIDATE_URL) !== false) ?: $this->error($field,
            __FUNCTION__);
    }
535108
private function parseSegments($field)
    {
        $segments = explode(':', $field);

        $name = array_shift($segments);
        $type = array_shift($segments);
        $arguments = [];
        $options = $this->parseOptions($segments);

        // Do we have arguments being used here?
        // Like: string(100)
        if (preg_match('/(.+?)\(([^)]+)\)/', $type, $matches)) {
            $type = $matches[1];
            $arguments = explode(',', $matches[2]);
        }

        return compact('name', 'type', 'arguments', 'options');
    }