@param mixed            $value
@param AbstractPlatform $platform

@return null|string
775882
public function convertToDatabaseValue($value, AbstractPlatform $platform)
    {
        return ($this->serializer)($value, $this->name, $platform);
    }
638549
public function convertToPHPValue($value, AbstractPlatform $platform): ?Status
    {
        if ($value === null) {
            return null;
        }

        return Status::fromString($value);
    }
1113923
public function getSqlType($value)
    {
        if ('boolean' === gettype($value)) {
            return $this->connection->getDatabasePlatform()->convertBooleans($value);
        } elseif (null === $value || 'null' === $value) {
            return 'NULL';
        }

        return $this->connection->quote($value);
    }
1298191
public function convertToDatabaseValue($value, AbstractPlatform $platform)
    {
        if (null === $value || '' === $value) {
            return $value;
        }

        if ( ! $value instanceof Email) {
            $type = is_object($value) ? get_class($value) : gettype($value);
            throw new \InvalidArgumentException(sprintf('You have to pass an object of kind \SerendipityHQ\Component\ValueObjects\Email\Email to use the Doctrine type EmailType. "%s" passed instead.', $type));
        }

        // Validate the $value as a valid email
        $validator = new EmailValidator();

        if ( ! $validator->isValid($value, new RFCValidation())) {
            throw new \InvalidArgumentException(sprintf('An email field accepts only valid email addresses. The value "%s" is not a valid email.', $value));
        }

        // The value is automatically transformed into a string thans to the __toString() method
        return $value;
    }
303441
public static function getText($value)
    {
        $enumItem = EnumParser::getInstance()->getEnumItem(static::class, $value);
        if($enumItem)
        {
            return $enumItem->text;
        }
        else
        {
            return null;
        }
    }
338640
public function getName(AbstractPlatform $platform)
    {
        return new Identifier(
            $this->fromTable instanceof Table ? $this->fromTable->getQuotedName($platform) : $this->name
        );
    }
787039
public function convertToPHPValue($value, AbstractPlatform $platform)
    {
        if ($value === null) {
            return;
        }

        $val = \DateTime::createFromFormat(
            $platform->getDateTimeFormatString(),
            $value,
            new \DateTimeZone('UTC')
        );
        if (!$val) {
            throw ConversionException::conversionFailed($value, $this->getName());
        }

        return $val;
    }
1040649
public function convertToPHPValue($value, AbstractPlatform $platform)
    {
        $result = null;

        if ($value !== null && ($dateOrNull = parent::convertToPHPValue($value, $platform)) !== null) {
            // despite the name it's not null already
            $result = DateTime::createFromDateTime($dateOrNull);
        }

        return $result;
    }
740542
public function convertToPHPValue($value, AbstractPlatform $platform)
    {
        $this->initializeDependencies();

        switch ($platform->getName()) {
            case 'postgresql':
                $value = (is_resource($value)) ? stream_get_contents($value) : $value;
                $array = parent::convertToPHPValue(hex2bin($value), $platform);
                break;
            default:
                $array = parent::convertToPHPValue($value, $platform);
        }
        $this->decodeObjectReferences($array);

        return $array;
    }
304785
private function dumpValue($value)
    {
        if ($value instanceof ServiceClosureArgument) {
            $value = $value->getValues()[0];
        }
        if ($value instanceof ArgumentInterface) {
            $tag = $value;

            if ($value instanceof TaggedIteratorArgument || ($value instanceof ServiceLocatorArgument && $tag = $value->getTaggedIteratorArgument())) {
                if (null === $tag->getIndexAttribute()) {
                    $content = $tag->getTag();
                } else {
                    $content = [
                        'tag' => $tag->getTag(),
                        'index_by' => $tag->getIndexAttribute(),
                    ];

                    if (null !== $tag->getDefaultIndexMethod()) {
                        $content['default_index_method'] = $tag->getDefaultIndexMethod();
                    }
                }

                return new TaggedValue($value instanceof TaggedIteratorArgument ? 'tagged' : 'tagged_locator', $content);
            }

            if ($value instanceof IteratorArgument) {
                $tag = 'iterator';
            } elseif ($value instanceof ServiceLocatorArgument) {
                $tag = 'service_locator';
            } else {
                throw new RuntimeException(sprintf('Unspecified Yaml tag for type "%s".', \get_class($value)));
            }

            return new TaggedValue($tag, $this->dumpValue($value->getValues()));
        }

        if (\is_array($value)) {
            $code = [];
            foreach ($value as $k => $v) {
                $code[$k] = $this->dumpValue($v);
            }

            return $code;
        } elseif ($value instanceof Reference) {
            return $this->getServiceCall((string) $value, $value);
        } elseif ($value instanceof Parameter) {
            return $this->getParameterCall((string) $value);
        } elseif ($value instanceof Expression) {
            return $this->getExpressionCall((string) $value);
        } elseif ($value instanceof Definition) {
            return new TaggedValue('service', (new Parser())->parse("_:\n".$this->addService('_', $value), Yaml::PARSE_CUSTOM_TAGS)['_']['_']);
        } elseif (\is_object($value) || \is_resource($value)) {
            throw new RuntimeException('Unable to dump a service container if a parameter is an object or a resource.');
        }

        return $value;
    }
1020861
private static function serializeValue( $value ) {
		try {
			return serialize( $value );
		} catch ( \Exception $ex ) {
			self::$logger->error( 'Value serialization failed: ' . $ex->getMessage() );
			return null;
		}
	}
1008138
public function convertToPHPValue($value, AbstractPlatform $platform)
	{
		if (is_null($value)) {
			return null;
		}
		
		$path = new Path($value);
		
		return $path;
	}
581710
public function convertToDatabaseValueSQL($sqlExpr, AbstractPlatform $platform)
    {
        return $this->getSpatialPlatform($platform)->convertToDatabaseValueSQL($this, $sqlExpr);
    }
132623
public function convertToDatabaseValue($value, AbstractPlatform $platform)
    {
        if ($value === null) {
            return $value;
        }

        if (! ($value instanceof GeometryInterface)) {
            throw new InvalidValueException('Geometry column values must implement GeometryInterface');
        }

        return $this->getSpatialPlatform($platform)->convertToDatabaseValue($this, $value);
    }
1101272
public function convertToPHPValue($value, AbstractPlatform $platform) : ?DateTime
    {
        if ($value === null || $value instanceof DateTime) {

            return $value;
        }

        if ( ! $this->getUtc() instanceof DateTimeZone) {

            $this->setUtc(new DateTimeZone('UTC'));
        }

        /** @var DateTime $converted */
        $converted = DateTime::createFromFormat(
            $platform->getDateTimeFormatString(),
            $value,
            $this->getUtc()
        );

        if ( ! $converted) {
            throw ConversionException::conversionFailedFormat(
                $value,
                $this->getName(),
                $platform->getDateTimeFormatString()
            );
        }

        return $converted;
    }
128281
public function convertToPHPValue($value, AbstractPlatform $platform)
    {
        $val = parent::convertToPHPValue($value, $platform);

        return $val->setTimezone(new \DateTimeZone('America/Sao_Paulo'));
    }
499048
public function getTypeOf($value)
    {
        foreach ($this->getPossibleTypes() as $type) {
            if ($isTypeOf = $type->isTypeOf($value)) {
                return $type;
            }

            if (!isset($isTypeOf)) {
                throw new \Exception(sprintf(
                    'Non-Object Type %s does not implement resolveType and Object ' .
                    'Type %s does not implement isTypeOf. There is no way to ' .
                    'determine if a value is of this type.', $this->getName(), $type->getName()
                ));
            }
        }

        return NULL;
    }