CrEOF\Spatial\DBAL\Platform\AbstractPlatform::newObjectFromValue PHP Method

newObjectFromValue() private method

Create spatial object from parsed value
private newObjectFromValue ( CrEOF\Spatial\DBAL\Types\AbstractSpatialType $type, array $value ) : CrEOF\Spatial\PHP\Types\Geometry\GeometryInterface
$type CrEOF\Spatial\DBAL\Types\AbstractSpatialType
$value array
return CrEOF\Spatial\PHP\Types\Geometry\GeometryInterface
    private function newObjectFromValue(AbstractSpatialType $type, $value)
    {
        $typeFamily = $type->getTypeFamily();
        $typeName = strtoupper($value['type']);
        $constName = sprintf('CrEOF\\Spatial\\PHP\\Types\\Geometry\\GeometryInterface::%s', $typeName);
        if (!defined($constName)) {
            // @codeCoverageIgnoreStart
            throw new InvalidValueException(sprintf('Unsupported %s type "%s".', $typeFamily, $typeName));
            // @codeCoverageIgnoreEnd
        }
        $class = sprintf('CrEOF\\Spatial\\PHP\\Types\\%s\\%s', $typeFamily, constant($constName));
        return new $class($value['value'], $value['srid']);
    }