Le 11/03/2011 17:24, César Hernández a écrit :

Regar

2.-
app/config/config.yml

# Doctrine Configuration
doctrine:
#   dbal:
#       dbname:   xxxxxxxx
#       user:     xxxxxxxx
#       password: ~
#       logging:  %kernel.debug%
#   orm:
#       auto_generate_proxy_classes: %kernel.debug%
#       mappings:
#           HelloBundle: ~
    doctrine_odm.mongodb:
        server: mongodb://localhost:27017
        default_database: prueba_%kernel.environment%
        options:
            connect: true
        metadata_cache_driver: array # array, apc, xcache, memcache

The config for DoctrineMongoDBBundle should not be put in the config of DoctrineBundle but in its own block. Thus is is doctrine_mongo_db, not doctrine_odm.mongodb
/src/MiEmpresa/AgendaBundle/AgendaBundle.php

I added the following code...

<?php

namespace MiEmpresa\AgendaBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class AgendaBundle extends Bundle
{
    /**
     * {@inheritdoc}
     */
    public function getNamespace()
    {
        return __NAMESPACE__;
    }

    /**
     * {@inheritdoc}
     */
    public function getPath()
    {
        return strtr(__DIR__, '\\', '/');
    }
}

These two methods are useless when you use PR7 (available in the standard distribution)

/src/MiEmpresa/AgendaBundle/Entities/Personas.php
I added the following code...

The default subnamespace for documents is Document, not Entities (and it is Entity for the ORM)


<?php

namespace MiEmpresa\AgendaBundle\Entity;

You namespace does not match the directory so it will not be found by the autoloader


/**
 * @mongodb:Document(collection="personas")
 */

class Personas
{
    /**
     * @mongodb:Id
     */
    private $id;

    /**
     * @mongodb:String
     */
    private $Nombres;

The annotations used by the ODM don't look this way anymore. It is now @mongodb:Field(type="string"). check the ODM doc for this.

}

run on the console
*php app/console doctrine:mongodb:schema:create*

and displays the following error message ...
*There are no commands defined in the "doctrine:mongodb:schema" namespace.*




--
Christophe | Stof

--
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 developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to