@param mixed $value

@return string
161757
public function transform($value)
    {
        if (function_exists('mb_check_encoding')) {
            $isUtf8 = mb_check_encoding($value, 'UTF-8');
        } else {
            $isUtf8 = $this->checkUtf8Encoding($value);
        }

        return  $isUtf8 ? $value : utf8_encode($value);
    }
232747
public static function getStringValue($value): string
    {
        if ($value instanceof \DateTime) {
            return $value->format(self::DEFAULT_DATETIME_FORMAT);
        } elseif (is_bool($value)) {
            return $value ? 'true' : 'false';
        } elseif (is_array($value)) {
            return implode(', ', array_map('self::getStringValue', $value));
        }

        return (string) $value;
    }
943738
public function displayValue( $value )
    {
        if ( $this->getUseRegularExpression() )
        {
            return preg_replace( $this->getFrom(), $this->getTo(), $value );
        }
        else
        {
            return str_replace( $this->getFrom(), $this->getTo(), $value );
        }
    }
590300
protected function wrapValue($value)
    {
        if ($this->isReserved($value)) {
            return Str::upper(parent::wrapValue($value));
        }

        return $value !== '*' ? sprintf($this->wrapper, $value) : $value;
    }
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;
        }
    }
913115
public function format($value)
  {
    if ($value===null) return null;

    $match = preg_match('/^(\d{4})-(\d{1,2})-(\d{1,2})$/', $value, $parts);
    $valid = ($match && checkdate((int)$parts[2], (int)$parts[3], (int)$parts[1]));
    if ($valid)
    {
      if ($value===$this->openDate) return '';

      $date = new \DateTime($value);

      return $date->format($this->format);
    }

    return $value;
  }
331723
protected function formatValue($value)
    {
        if ($this->formatValue !== NULL) {
            return str_replace(static::VALUE_IDENTIFIER, $value, $this->formatValue);
        } else {
            return $value;
        }
    }
1188551
public function transform($value)
    {
        if (null === $value) {
            return '';
        }

        if (!$this->mask) {
            return $value;
        }

        return str_repeat($this->maskSymbol, $this->maskLength);
    }
187880
private function writeValue($value): string
    {
        if ('%%%%not_defined%%%%' === $value) {
            return '';
        }

        if (\is_string($value) || is_numeric($value)) {
            return $value;
        }

        if (false === $value) {
            return 'false';
        }

        if (true === $value) {
            return 'true';
        }

        if (null === $value) {
            return 'null';
        }

        if (empty($value)) {
            return '';
        }

        if (\is_array($value)) {
            return implode(',', $value);
        }
    }
279641
public function getString($value)
    {
        $number = floatval($value);
        $number = round(($number + 0.000001) * 20) / 20;

        return sprintf('CHF %s',
            number_format($number, 2, '.', '\'')
        );
    }
345162
protected function serializeValue($value)
    {
        $serialized = var_export($value, true);
        if ($serialized === 'NULL') {
            $serialized = strtolower($serialized);
        }

        return $serialized;
    }
219134
private function tostring($value)
    {
        if (!isset($value)) {
            return 'null';
        }
        if ($value === true) {
            return 'true';
        }
        if ($value === false) {
            return 'false';
        }
        if (is_array($value)) {
            $out = '[';
            $i = 0;
            foreach ($value as $key => $entry) {
                if ($i) {
                    $out .= ', ';
                }
                $out .= $key.' => '.$this->tostring($entry);
                $i++;
            }
            $out .= ']';
            return $out;
        }
    }
1126025
public function getEncryptedValue($value): string
    {
        return strtoupper(
            hash_hmac(static::HASH_TYPE, $value, $this->config->getHmacPassword())
        );
    }
1310957
public function transform($value): ?string
    {
        /** TODO add sanity check is array of Location object? */
        if (!is_array($value) || empty($value)) {
            return null;
        }

        return implode(',', array_column($value, 'id'));
    }
881112
public function serialize($value): string
    {
        $id = $this->entityManager->getClassMetadata($this->className)->getIdentifierValues($value);

        return (string) reset($id);
    }
217085
public function getString($value)
    {
        if (is_array($value)
            || $value instanceof \Iterator) {
            return '';
        }
        if ($value instanceof Collection) {
            $value = $value->toArray();
        }
        return implode(',', $value);
    }
202297
public function transform($value)
    {
        if (null === $value || !($value instanceof Collection)) {
            return '';
        }

        $string = '';
        foreach ($value as $item) {
            $string .= $item->getId();

            if ($value->last() != $item) {
                $string .= ',';
            }
        }

        return $string;
    }