creof / doctrine2-spatial

Doctrine2 multi-platform support for spatial types and functions.
MIT License
273 stars 175 forks source link

Error in documentation for configuration Symfony #181

Open jeremy-hyde opened 7 years ago

jeremy-hyde commented 7 years ago

On this page The config is:

doctrine:
    dbal:
        types:
            geometry:   CrEOF\Spatial\DBAL\Types\GeometryType
            point:      CrEOF\Spatial\DBAL\Types\Geometry\PointType
            polygon:    CrEOF\Spatial\DBAL\Types\Geometry\PolygonType
            linestring: CrEOF\Spatial\DBAL\Types\Geometry\LineStringType

    orm:
        dql:
            numeric_functions:
                st_contains:     CrEOF\Spatial\ORM\Query\AST\Functions\MySql\STContains
                contains:     CrEOF\Spatial\ORM\Query\AST\Functions\MySql\Contains
                st_area:         CrEOF\Spatial\ORM\Query\AST\Functions\MySql\Area
                st_geomfromtext: CrEOF\Spatial\ORM\Query\AST\Functions\MySql\GeomFromText
                st_intersects:     CrEOF\Spatial\ORM\Query\AST\Functions\MySql\STIntersects
                st_buffer:     CrEOF\Spatial\ORM\Query\AST\Functions\MySql\STBuffer
                point: CrEOF\Spatial\ORM\Query\AST\Functions\MySql\Point

And should be:

doctrine:
    dbal:
        types:
            geometry:   CrEOF\Spatial\DBAL\Types\GeometryType
            point:      CrEOF\Spatial\DBAL\Types\Geometry\PointType
            polygon:    CrEOF\Spatial\DBAL\Types\Geometry\PolygonType
            linestring: CrEOF\Spatial\DBAL\Types\Geometry\LineStringType

    orm:
        entity_managers:
            default:
                dql:
                    numeric_functions:
                        st_contains:     CrEOF\Spatial\ORM\Query\AST\Functions\MySql\STContains
                        contains:     CrEOF\Spatial\ORM\Query\AST\Functions\MySql\Contains
                        st_area:         CrEOF\Spatial\ORM\Query\AST\Functions\MySql\Area
                        st_geomfromtext: CrEOF\Spatial\ORM\Query\AST\Functions\MySql\GeomFromText
                        st_intersects:     CrEOF\Spatial\ORM\Query\AST\Functions\MySql\STIntersects
                        st_buffer:     CrEOF\Spatial\ORM\Query\AST\Functions\MySql\STBuffer
                        point: CrEOF\Spatial\ORM\Query\AST\Functions\MySql\Point

Source: Doc Symfony

yurtesen commented 7 years ago

This is not an error. Symfony manual clearly tells that this way is used often in documentation. See Shortened Configuration Syntax

When you are only using one entity manager, all config options available can be placed directly under doctrine.orm config level.

This shortened version is commonly used in other documentation sections. Keep in mind that you can't use both syntaxes at the same time.