Question

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;
}
Was it helpful?

Solution

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;
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top