I´m starting with Symfony 2 and I´m following a tutorial. The tutorial is perfect but a little detail.
I have a Entity Tienda.php inside the folder TiendaBundle with properties and well mapped. Is this:
// src/Cupon/TiendaBundle/Entity/Tienda.php
namespace Cupon\TiendaBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/** @ORM\Entity */
class Tienda
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue
*/
protected $id;
/** @ORM\Column(type="string", length=100) */
protected $nombre;
/** @ORM\Column(type="string", length=100) */
protected $slug;
/** @ORM\Column(type="string", length=10) */
protected $login;
/** @ORM\Column(type="string", length=255) */
protected $password;
/** @ORM\Column(type="string", length=255) */
protected $salt;
/** @ORM\Column(type="text") */
protected $descripcion;
/** @ORM\Column(type="text") */
protected $direccion;
/** @ORM\ManyToOne(targetEntity="Cupon\CiudadBundle\Entity\Ciudad") */
protected $ciudad;
}
My intention is generate the getters and setters automatically with task:
G:\xampp\htdocs\cupon>php app/console generate:doctrine:entities TiendaBundle
This task generates the following error:
[RuntimeException]
Can´t find base path for "TiendaBundle" (path: "G:\xampp\htdocs\cupon\src\cupon\TiendaBundle", destination: G:\xampp\htdocs\cupon\src\cupon\TiendaBundle").
doctrine:generate:entities [--path="..."] [--no-backup] name
I need generate getters and setters automatically for others projects more larger. I hope your help plis!
php app/console doctrine:generate:entitywhich ask for the BundleName and(:) entity name; then you will ask for field names - JavadAppKernel.php- Javad