{@inheritdoc}

@param mixed $value

@return string|null $id
357181
public function key($value)
    {

        foreach ($this->candidates as $categorizer) {
            $result = $categorizer->key($value);
            if ($result !== null) {
                return $result;
            }
        }

        $name = is_object($value) ? get_class($value) : gettype($value);

        throw new HandlerNotFoundException("No handler found to provide an id for type '$name'");
    }
891343
public static function tryGetTypeForValue($value)
    {
        if (!is_object($value)) {
            return null;
        }

        // maybe it's a ValueObject

        // try get type name from types map
        $className = get_class($value);
        if (isset(self::$typesMap[$className])) {
            return Type::getType(self::$typesMap[$className]);
        }

        // use class name as type name
        $classNameParts = explode('\\', $className);
        $typeName = array_pop($classNameParts);

        if (array_key_exists($typeName, Type::getTypesMap())) {
            return Type::getType($typeName);
        }

        return null;
    }
1267385
public function newInstance($value = null)
    {
        $class = $this->getClassName();
        $o = new $class($value, $this->encoding);
        return $o;
    }
262924
public function decode(string $value): ?int
    {
        $value = $this->hashids->decode($value);

        if (is_array($value) && sizeof($value) > 0) {
            return $value[0];
        } else {
            return null;
        }
    }
704606
public function output($value = null)
    {
        $value = is_null($value) ? $this->value : $value;

        return $this->isRepeatable()
            ? $this->outputRepeatable().$this->getExplanation()
            : $this->outputInput($value).$this->getExplanation();
    }
858208
public function value( $value = NULL ){
		if( is_null( $value ) )
			return $this->value;
		$this->value	= $value;
	}
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'));
    }
904949
public function set($id, $value = null)
    {
        if ($this->locked) {
            return false;
        }

        if (is_array($id)) {
            foreach ($id as $k => $v) {
                $this->set($k, $v);
            }
        } elseif (is_string($id)) {
            return $this->setItem($id, $value);
        } else {
            return false;
        }
    }
923755
public function transform($value)
    {
        if (null === $value) {
            return null;
        }

        if (!$value instanceof APIRoleAssignment) {
            throw new TransformationFailedException('Expected a ' . APIRoleAssignment::class . ' object.');
        }

        return $value->id;
    }
1020861
private static function serializeValue( $value ) {
		try {
			return serialize( $value );
		} catch ( \Exception $ex ) {
			self::$logger->error( 'Value serialization failed: ' . $ex->getMessage() );
			return null;
		}
	}
1035534
public function name($value = null)
    {
        if (func_num_args()) {
            $this->name = $value;
            return $this;
        }
        return $this->name;
    }
304280
public function transform($value): ?string
    {
        if (null === $value) {
            return null;
        }

        if (!is_array($value) || array_diff(['id', 'module', 'function'], array_keys($value))) {
            throw new TransformationFailedException('Expected a valid array of data.');
        }

        return implode(':', [$value['id'], $value['module'], $value['function']]);
    }
1184103
public function getRefId($value)
    {
        $id = $this->getValueId($value);

        return $id ? new RefIdValueObject($id) : null;
    }
303441
public static function getText($value)
    {
        $enumItem = EnumParser::getInstance()->getEnumItem(static::class, $value);
        if($enumItem)
        {
            return $enumItem->text;
        }
        else
        {
            return null;
        }
    }
87414
public static function fromValue($value)
    {
        foreach (static::values() as $key => $enumInstance) {
            if ($enumInstance->getValue() === $value) {
                return $enumInstance;
            }
        }

        return null;
    }
941542
public static function get($name, $value = NULL)
    {
        return isset($_GET[$name]) ? $_GET[$name] : $value;
    }
999633
public function transform($value)
    {
        if (null === $value) {
            return null;
        }

        if (!$value instanceof APIRole) {
            throw new TransformationFailedException('Expected a ' . APIRole::class . ' object.');
        }

        return $value->id;
    }