1

I am trying to generate getter and setter for entity class by using

php app/console doctrine:generate:entities Acme/WebsiteBundle/Entity/W_user

But getting following error:

Fatal error: Cannot redeclare class Acme\WebsiteBundle\Entity\W_user in C:\xampp
\htdocs\labeeb-projects\Symfony\src\Acme\WebsiteBundle\Entity\W_user.php on line
 11

My entity class is following:

<?php
namespace Acme\WebsiteBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
* @ORM\Entity
**/
class W_user
{   
    /*
    * @ORM\Column(type="string")
    */
    protected $w_first_name;
}
user3109712
  • 73
  • 2
  • 7

1 Answers1

1

That class already exists. Instead, you should extend the parent class and name your clas something else.

Class WW_user extends W_user{
    private $w_first_name;
}
Ohgodwhy
  • 49,779
  • 11
  • 80
  • 110