@param \Netgen\TagsBundle\Core\FieldType\Tags\Value $value

@return array|null
338068
public function transform($value)
    {
        if (!$value instanceof Value) {
            return null;
        }

        $ids = [];
        $parentIds = [];
        $keywords = [];
        $locales = [];

        foreach ($value->tags as $tag) {
            $tagKeyword = $tag->getKeyword($this->field->languageCode);
            $mainKeyword = $tag->getKeyword();

            $ids[] = $tag->id;
            $parentIds[] = $tag->parentTagId;
            $keywords[] = $tagKeyword !== null ? $tagKeyword : $mainKeyword;
            $locales[] = $tagKeyword !== null ? $this->field->languageCode : $tag->mainLanguageCode;
        }

        return [
            'ids' => implode('|#', $ids),
            'parent_ids' => implode('|#', $parentIds),
            'keywords' => implode('|#', $keywords),
            'locales' => implode('|#', $locales),
        ];
    }
947296
public function filter($value)
    {
        return true === array_key_exists((string)$value, $this->translations) ? $this->translations[$value] : null;
    }
628103
public function apply(Value $value): array
    {
        if ($value->isEmpty()) {
            return $this->null();
        }

        try {
            return $this->filtered(Week::fromString($value->value()));
        } catch (\InvalidArgumentException $iae) {
            return $this->error('WEEK_INVALID');
        }
    }
696172
static public function keywords($value=null)
    {
        if ($value) {
            $value = StringHelper::str_cut(strip_tags($value), 100);
        }
        
        return static::input(trim($value));
    }
1004528
public function transform($value)
    {
        try {
            return array(
                'id' => (null !== $value ? $value->getId() : null),
                'value' => (null !== $value ? $value->__toString() : null)
            );
        } catch (EntityNotFoundException $e) {
            return ['id' => null, 'value' => '-- ENTITY NOT FOUND --'];
        }
    }
996862
protected function findEntity($value)
    {
        $result = $this->finder->{$this->findMethod}($value);

        if ($result === null) {
            return [];
        }

        return (array) $result;
    }
1098392
public function filter($value)
    {
        return in_array($value, $this->getList(), $this->getStrict()) ? $value : null;
    }
1244339
public function lists($value)
    {
        return array_map(function ($item) use ($value) {
            return isset($item[$value]) ? $item[$value] : null;
        }, $this->items);
    }
851822
private static function toPlainValue($value)
    {
        if (is_string($value)) {
            $value = strip_tags($value);
            $value = html_entity_decode($value, ENT_QUOTES | ENT_XML1, 'UTF-8');
            $value = trim($value);

            return ($value === '') ? null : $value;
        }

        return $value;
    }
1153954
public static function convertToPhp($value)
    {
        if (!is_array($value)) {
            return [];
        }

        // see DateType::convertToPHPValue()
        $convertor = function ($value) {
            try {
                return DateType::getDateTime($value);
            } catch (\InvalidArgumentException $e) {
                return null;
            }
        };

        return array_values(array_filter(array_map($convertor, $value)));
    }
87414
public static function fromValue($value)
    {
        foreach (static::values() as $key => $enumInstance) {
            if ($enumInstance->getValue() === $value) {
                return $enumInstance;
            }
        }

        return null;
    }
189818
public function makeStorableArrayFieldValue($value)
    {
        if ($this->_isEncodedArrayFieldValue($value)) {
            $value = $this->_decodeArrayFieldValue($value);
        }

        $value = $this->_serializeValue($value);
        return $value;
    }
905253
public function setTags($value)
    {
        if (!is_array($value)) {
            $value = [$value];
        }

        $this->values['tags'] = implode(',', $value);

        return $this;
    }
831894
public function stripTags($value)
	{
		if ( ! is_array($value))
		{
			$value = filter_var($value, FILTER_SANITIZE_STRING);
		}
		else
		{
			foreach ($value as $k => $v)
			{
				$value[$k] = $this->stripTags($v);
			}
		}

		return $value;
	}
1075679
public function getUserValue($value)
    {
        if (! is_array($value)) {
            if ('' == $value) {
                $value = [];
            } else {
                $value = explode($this->getSeparator(), $value);
            }
        }

        return $value;
    }
526423
public function filter($value) {

        if($value === null && $this->options["preserve_null"] )
            return null;

        return strip_tags($value, $this->options["allowable_tags"]);
    }
575733
protected function parseStringsToNativeTypes($value)
    {
        if (is_array($value)) {
            return array_map([$this, 'parseStringsToNativeTypes'], $value);
        }

        if (! is_string($value)) {
            return $value;
        }

        $parsedValue = json_decode($value, true);

        if (json_last_error() === JSON_ERROR_NONE) {
            return $parsedValue;
        }

        return $value;
    }