Doctrine\ODM\OrientDB\Mapper\Hydration\Hydrator::hydrateValue PHP Method

hydrateValue() protected method

Hydrates the value
protected hydrateValue ( $value, Property $annotation ) : mixed | null
$value
$annotation Doctrine\ODM\OrientDB\Mapper\Annotations\Property
return mixed | null
    protected function hydrateValue($value, PropertyAnnotation $annotation)
    {
        if ($annotation->type) {
            try {
                $value = $this->castProperty($annotation, $value);
            } catch (\Exception $e) {
                if ($annotation->isNullable()) {
                    $value = null;
                } else {
                    throw $e;
                }
            }
        }
        return $value;
    }