symfony-cmf / symfony-cmf-docs

The documentation for the symfony content management framework
http://cmf.symfony.com
44 stars 157 forks source link

Is there an example ANYWHERE on how to use dynamic router with orm persistence (NOT phpcr) #675

Closed mdford closed 9 years ago

mdford commented 9 years ago

I have been trying in vain to get the Doctrine Orm (not phpcr) version of RouteProvider working. I simply want to use the dynamic router and pull routes from my mysql database. I do not need any of the phpcr functionality. But, this seemingly simple task has proven to be impossible.

I have searched everywhere, asked on forums, tried asking on cmf irc channel (no one ever seems to respond to anything there), etc.

Can you point me to a simple example of using the ORM provider?? PHPCR examples abound, but nothing for just the orm version.

I have tried everything, and seem to be close, but I cannot get past the following error:

[2015-04-13 10:02:31] request.CRITICAL: Uncaught PHP Exception Doctrine\Common\Persistence\Mapping\MappingException: "No mapping file found named 'Symfony.Cmf.Bundle.RoutingBundle.Doctrine.Orm.Route.php' for class 'Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Orm\Route'." at /vagrant/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php line 75 {"exception":"[object] (Doctrine\\Common\\Persistence\\Mapping\\MappingException(code: 0): No mapping file found named 'Symfony.Cmf.Bundle.RoutingBundle.Doctrine.Orm.Route.php' for class 'Symfony\\Cmf\\Bundle\\RoutingBundle\\Doctrine\\Orm\\Route'. at /vagrant/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php:75)"} []

my config.yml:

cmf_routing:
    dynamic:
      enabled: true
      persistence:
          orm:
              enabled:      true
              manager_name: ~
    chain:
        routers_by_id:
            cmf_routing.dynamic_router: 200
            router.default: 100

I can provide more config, files, etc. if someone wants to see them. Or, simply providing a working example of how to make all the pieces work would be fine. Thanks in advance for ANY help. I really want to use what you guys have created but keep running into obstacles.

lsmith77 commented 9 years ago

managed to clear up this issue via IRC. was using an out of date versions of CoreBundle / DoctrineBundle as explained in the docs