Please post questions about how to use Symfony to the symfony-users mailing 
list.

Thanks,
Kris
On Friday, March 11, 2011 at 8:24 AM, César Hernández wrote: 
> Regards,
> 
> I'm trying to prove Symfony2 with a database MongoDB 
> 
> MongoDB found that is running, using "moadmin.php" ... 
> this is what I did:...
> 
> 
> 1.- 
> app/AppKernel.php
> ...
> // enable third-party bundles
>  new Symfony\Bundle\ZendBundle\ZendBundle(),
>  new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
>  new Symfony\Bundle\DoctrineBundle\DoctrineBundle(),
>  //new Symfony\Bundle\DoctrineMigrationsBundle\DoctrineMigrationsBundle(),
> new Symfony\Bundle\DoctrineMongoDBBundle\DoctrineMongoDBBundle(),
> ...
> 
> 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
> 
> 3. 
> /app/autoload.php 
> I added the following line...
>  'MiEmpresa'  => __DIR__.'/../src',
> 
> 4. 
> /app/AppKernel.php
> I added the following line...
>  new MiEmpresa\AgendaBundle\AgendaBundle(),
> 
> 
> 5. 
> /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__, '\\', '/');
>  }
> } 
> 
> 
>  6.
> /src/MiEmpresa/AgendaBundle/Entities/Personas.php
> I added the following code...
> 
> <?php
> 
> namespace MiEmpresa\AgendaBundle\Entity;
> 
> /**
> * @mongodb:Document(collection="personas")
> */
> 
> class Personas
> {
>  /**
>  * @mongodb:Id
>  */
>  private $id;
> 
>  /**
>  * @mongodb:String
>  */
>  private $Nombres;
> 
>  /**
>  * @mongodb:String
>  */
>  private $PrimerApellido;
> 
>  /**
>  * @mongodb:String
>  */
>  private $SegundoApellido;
> 
>  /**
>  * @mongodb:date
>  */
>  private $FechaNacimiento;
> 
>  /**
>  * @mongodb:String
>  */
>  private $Telefono;
> 
>  /**
>  * Get id
>  *
>  * @return integer $id
>  */
>  public function getId()
>  {
>  return $this->id;
>  }
> 
>  public function getNombres()
>  {
>  return $this->Nombres;
>  }
> 
>  public function setNombres($Nombres)
>  {
>  $this->Nombres = $Nombres;
>  }
> 
>  public function getPrimerApellido()
>  {
>  return $this->PrimerApellido;
>  }
> 
>  public function setPrimerApellido($PrimerApellido)
>  {
>  $this->PrimerApellido = $PrimerApellido;
>  }
> 
>  public function getSegundoApellido()
>  {
>  return $this->SegundoApellido;
>  }
> 
>  public function setSegundoApellido($SegundoApellido)
>  {
>  $this->SegundoApellido = $SegundoApellido;
>  }
> 
>  public function getFechaNacimiento()
>  {
>  return $this->FechaNacimiento;
>  }
> 
>  public function setFechaNacimiento($FechaNacimiento)
>  {
>  $this->FechaNacimiento = $FechaNacimiento;
>  }
> 
>  public function getTelefono()
>  {
>  return $this->Telefono;
>  }
> 
>  public function setTelefono($Telefono)
>  {
>  $this->Telefono = $Telefono;
>  }
> }
> 
> 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. 
> Is it some bug? Or am I doing something wrong
> I appreciate your comments!
> 
> 
> -- 
> César Hernández
> Anzoátegui - Venezuela
> [email protected]
> 
> LinuxCounter: 285.345 
> CIV: 122.539
>  -- 
>  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
> 

-- 
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