Returns the name of the given field value.

It will be used to generate content name and url alias if current field is designated
to be used in the content name/urlAlias pattern.

@param \eZ\Publish\Core\FieldType\Image\Value $value

@return string
17910
public function getName(SPIValue $value)
    {
        return !empty($value->alternativeText) ? $value->alternativeText : (string)$value->fileName;
    }
1184828
public function getNameAttribute($value)
    {
        if ($this->person) return $this->person->givenName . ' ' . $this->person->sn1 . ' ' . $this->person->sn2;
        return $value;
    }
475872
public function getFieldName(SPIValue $value, FieldDefinition $fieldDefinition, $languageCode)
    {
        return $this->fieldType->getName($value);
    }
881112
public function serialize($value): string
    {
        $id = $this->entityManager->getClassMetadata($this->className)->getIdentifierValues($value);

        return (string) reset($id);
    }
1160577
private function getLabelForValue($fieldConfiguration, $value)
    {
        $label = "";
        foreach ($fieldConfiguration['options'] as $option) {
            if ($option['value'] == $value) {
                $label = $option['label'];
            }
        }

        return $label;
    }
881602
public function encodeValue($value)
    {
        if ($this->urlEncode == self::RFC_3986) {
            return rawurlencode($value);
        } elseif ($this->urlEncode == self::FORM_URLENCODED) {
            return urlencode($value);
        } else {
            return (string) $value;
        }
    }
920505
protected function _value($value)
    {
        if ($value === null) {
            return 'null';
        }
        if ($value === true) {
            return 'true';
        }
        if ($value === false) {
            return 'false';
        }

        return (string)$value;
    }
885430
protected function id2alias($value)
    {
        $association = $this->associationRepository->findByID($value);

        $alias = $association->getName();

        if (!$this->isNameUnique($association)) {
            $alias = $alias . self::SEPARATOR_OFFSET . dechex(intval($association->getID()));
        }

        return $this->cleanUrl($alias);
    }
592332
public function getCreatedByAttribute($value)
    {
        if ($value > 0)
            if ($user = Sentinel::findUserById($value))
                if ($user != null)
                    return $user->first_name . ' ' . $user->last_name . ' (ID: ' . $user->id . ')';

        return $value;
    }
928076
public function filter($value)
    {
        if (empty($value) && isset($this->filterData[$this->fieldToSlugFrom])) {
            $value = $this->filterData[$this->fieldToSlugFrom];
        }

        if (is_null($value)) {
            return $this->setEmpty();
        }

        $value = transliterator_transliterate($this->transliterator, $value);
        $value = iconv("UTF-8", "ASCII//TRANSLIT//IGNORE", $value);
        $value = preg_replace('/[^\w\d]+/', '-', $value);
        $value = trim($value, '-');
        return strtolower($value);
    }
1081629
public function sanitize( $value ) {

		// is the value formatted as a string?
		if ( is_string( $value ) ) {
			$value = rawurldecode( $value );
			$value = json_decode( $value, true );
		}

		// Nothing to sanitize if we don't have fields.
		if ( empty( $this->fields ) ) {
			return $value;
		}

		foreach ( $value as $row_id => $row_value ) {

			// Make sure the row is formatted as an array.
			if ( ! is_array( $row_value ) ) {
				$value[ $row_id ] = [];
				continue;
			}

			// Start parsing sub-fields in rows.
			foreach ( $row_value as $subfield_id => $subfield_value ) {

				// Make sure this is a valid subfield.
				// If it's not, then unset it.
				if ( ! isset( $this->fields[ $subfield_id ] ) ) {
					unset( $value[ $row_id ][ $subfield_id ] );
				}

				// Get the subfield-type.
				if ( ! isset( $this->fields[ $subfield_id ]['type'] ) ) {
					continue;
				}
				$subfield_type = $this->fields[ $subfield_id ]['type'];

				// Allow using a sanitize-callback on a per-field basis.
				if ( isset( $this->fields[ $subfield_id ]['sanitize_callback'] ) ) {
					$subfield_value = call_user_func( $this->fields[ $subfield_id ]['sanitize_callback'], $subfield_value );
				} else {

					switch ( $subfield_type ) {
						case 'image':
						case 'cropped_image':
						case 'upload':
							if ( ! is_numeric( $subfield_value ) && is_string( $subfield_value ) ) {
								$subfield_value = esc_url_raw( $subfield_value );
							}
							break;
						case 'dropdown-pages':
							$subfield_value = (int) $subfield_value;
							break;
						case 'color':
							if ( $subfield_value ) {
								$color_obj      = \ariColor::newColor( $subfield_value );
								$subfield_value = $color_obj->toCSS( $color_obj->mode );
							}
							break;
						case 'text':
							$subfield_value = sanitize_text_field( $subfield_value );
							break;
						case 'url':
						case 'link':
							$subfield_value = esc_url_raw( $subfield_value );
							break;
						case 'email':
							$subfield_value = filter_var( $subfield_value, FILTER_SANITIZE_EMAIL );
							break;
						case 'tel':
							$subfield_value = sanitize_text_field( $subfield_value );
							break;
						case 'checkbox':
							$subfield_value = (bool) $subfield_value;
							break;
						case 'select':
							if ( isset( $this->fields[ $subfield_id ]['multiple'] ) ) {
								if ( true === $this->fields[ $subfield_id ]['multiple'] ) {
									$multiple = 2;
								}
								$multiple = (int) $this->fields[ $subfield_id ]['multiple'];
								if ( 1 < $multiple ) {
									$subfield_value = (array) $subfield_value;
									foreach ( $subfield_value as $sub_subfield_key => $sub_subfield_value ) {
										$subfield_value[ $sub_subfield_key ] = sanitize_text_field( $sub_subfield_value );
									}
								} else {
									$subfield_value = sanitize_text_field( $subfield_value );
								}
							}
							break;
						case 'radio':
						case 'radio-image':
							$subfield_value = sanitize_text_field( $subfield_value );
							break;
						case 'textarea':
							$subfield_value = html_entity_decode( wp_kses_post( $subfield_value ) );

					}
				}
				$value[ $row_id ][ $subfield_id ] = $subfield_value;
			}
		}
		return $value;
	}
1025757
public function getFullnameAttribute($value)
    {
        if (!strlen($this->firstname) and ! strlen($this->lastname)) {
            return '---';
        }
        return $this->firstname . ' ' . $this->lastname;
    }
942828
private function getValue($value)
    {
        if (!is_string($value)) {
            return $value;
        }

        if ($value[0] != '%' || $value[strlen($value) - 1] != '%')  {
            return $value;
        }

        $parameter = trim($value, '%');
        if ($this->container->hasParameter($parameter)) {
            return $this->container->getParameter($parameter);
        }

        return $value;
    }
266638
protected static function getValueAsINI($value)
    {
        $string = '';

        switch (gettype($value)) {
            case 'integer':
            case 'double':
                $string = $value;
                break;

            case 'boolean':
                $string = $value ? 'true' : 'false';
                break;

            case 'string':
                // Sanitize any CRLF characters..
                $string = '"' . str_replace(["\r\n", "\n"], '\\n', $value) . '"';
                break;
        }

        return $string;
    }
145736
public static function path($value): string
    {
        $pattern = '#^[A-Za-z0-9_\/-]+[A-Za-z0-9_\.-]*([\\\\\/][A-Za-z0-9_-]+[A-Za-z0-9_\.-]*)*$#';
        preg_match($pattern, $value, $matches);
        return isset($matches[0]) ? (string)$matches[0] : '';
    }
1014207
protected function getImagesPerPageArg( $value = null )
	{
		$perPage = $this->getValue( 'images_per_page', $value );

		if( !is_numeric( $perPage ) && is_string( $perPage )) {
			$perPage = $this->postmeta->get( $perPage );
		}
		return !!intval( $perPage )
			? $perPage
			: -1;
	}
53466
protected function handleImageValue(ImageValue $value, $fieldDefinitionIdentifier, $languageCode)
    {
        if (!$value->uri) {
            return '';
        }

        return $this->getVariation(
            $value,
            $fieldDefinitionIdentifier,
            $languageCode,
            "social_network_image"
        );
    }