maybe it's a config-problem. Try this:

doctrine:
    orm:
        mappings:
            HelloBundle: { type: yaml, dir: path/to/mapping/dir }

The dir is relative to the bundle dir.



Am 28.02.2011 18:14, schrieb oscar balladares:
Do you have your entity mapped in Sensio/HelloBundle/Resources/config/doctrine/metadata/orm/Sensio.HelloBundle.Entity.YourEntityName.dcm.yml
???

something like:

//Sensio.HelloBundle.Entity.User.dcm.yml

Sensio\HelloBundle\Entity\User:
    type:  entity
    table:  user
    id:
        id:
            type:  integer
            generator:
                strategy:  IDENTITY
    fields:
        name:
            type:  string
            length:  50
        lastname:
            type:  string
            length: 50
        address:
            type:  string
            length: 100
        new:
            type:  string
            length: 50
Also you need to clear the cache, as Chris, said.
I had some headaches with the cache, I had to clear it, but before doing the "doctrine:generate:entities HelloBundle" I had to
warmup the cache.

So try clearing the cache, running the command, if not, clear the cache and warmup it, and then run the command.


2011/2/28 Christian Schaefer <cae...@gmail.com <mailto:cae...@gmail.com>>


    hmm.. I'm doing it almost the same way than you.

    $ php app/console doctrine:mapping:import "HelloBundle" xml (I use xml
    actually but that doesn't matter much)
    $ php app/console doctrine:generate:entities "HelloBundle"

    remember to delete all backups in HelloBundle/Entity/ (starting with a
    '~').

    this is my app/config/config.yml

     66 # Doctrine Configuration
     67 doctrine:
     68    dbal:
     69        dbname:   my_db
     70        user:     root
     71        password: my_pw
     72        logging:  %kernel.debug%
     73    orm:
     74        auto_generate_proxy_classes: %kernel.debug%
     75        mappings:
     76            HelloBundle: ~

    also remember to clear the cache.

    On 21 Feb., 00:42, fa <florent.arcam...@gmail.com
    <mailto:florent.arcam...@gmail.com>> wrote:
    > Hi everyone
    >
    > That's my first try with Sf2 Sandbox pr6.
    >
    > I v got BDD  on mysql done with mysqlWorkbench
    >
    > I mange to configure my connection
    >
    > ## Doctrine Configuration
    > doctrine.dbal:
    >     dbname:   mydbname
    >     user:     root
    >     password: null
    >     logging:  %kernel.debug%
    > doctrine.orm:
    >     default_entity_manager: default
    >     auto_generate_proxy_classes: %kernel.debug%
    >     entity_managers:
    >         default:
    >             connection:       default
    >     mappings:
    >         #HelloBundle: ~
    >         #HelloBundle: { type: yml, dir: Resources/config/doctrine/
    > mapping }
    >         HelloBundle: { type: yml, dir: Resources/config/doctrine/
    > metadata/orm }
    >
    > I ve try to create the schema.yml from the bdd like Iwas use to
    do in
    > sf1
    >
    > So in the CLI i typed:
    > php app/console doctrine:mapping:import "HelloBundle" yml
    --em=default
    >
    > It generated me lots of file in my
    > rep
    > SandBox\Sensio\HelloBundle\Resources\config\doctrine\metadata\orm
    >
    > My pb is when I try to generate entities from this import:
    >
    > C:\wamp\www\symfony2\sandbox>php app/console doctrine:mapping:info
    > Found 0 entities mapped in entity manager 'default'
    >
    > or when I try:
    >
    > C:\wamp\www\symfony2\sandbox>php app/console
    > doctrine:generate:entities "HelloBundle"
    >
    >   [RuntimeException]
    >   Bundle HelloBundle does not contain any mapped entities.
    >
    > Any help would be rea

    --
    If you want to report a vulnerability issue on symfony, please
    send it to security at symfony-project.com
    <http://symfony-project.com>

    You received this message because you are subscribed to the Google
    Groups "symfony users" group.
    To post to this group, send email to
    symfony-users@googlegroups.com <mailto:symfony-users@googlegroups.com>
    To unsubscribe from this group, send email to
    symfony-users+unsubscr...@googlegroups.com
    <mailto:symfony-users%2bunsubscr...@googlegroups.com>
    For more options, visit this group at
    http://groups.google.com/group/symfony-users?hl=en


--
If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

--
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to