Details
Description
I have two classes.
One extends from another. I'm using the annotation @MappedSuperclass
and operates correctly, but when he did the entities generation
through the command console, doctrine adds the property and the
methods of the "father" class in the subclass.
This is a bug of the command console?
Really you should not copy them if you do not extend them. When you
run the update of the database schema, i must delete these fields and
methods added to obtain the desired result.
What happens?
Im usign Symfony 2.
Thanks!!!!
Code:
Father class:
/********************************************************************
/**
- @ORM\MappedSuperclass
*/
abstract class ConfigBase
{
/**
- @ORM\Column(name="enabled", type="boolean")
*/
protected $enabled;
/**
- Set enabled
* - @param boolean $enabled
*/
public function setEnabled($enabled) { $this->enabled = $enabled; }
/**
* Get enabled
*
* @return boolean
*/
public function getEnabled()
{ return $this->enabled; }
}
/********************************************************************
SubClass
/********************************************************************
/**
* @ORM\Entity
*
*/
class UserConfig extends ConfigBase
{
/**
* @var integer $id
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* Get id
*
* @return integer
*/
public function getId()
{ return $this->id; }
/************************************************/
/* Auto generated and non desired values */
/************************************************/
/**
* @var boolean $enabled
*/
private $enabled;
/**
* Set enabled
*
* @param boolean $enabled
*/
public function setEnabled($enabled)
{ $this->enabled = $enabled; }
/**
- Get enabled
* - @return boolean
*/
public function getEnabled() { return $this->enabled; }
Issue Links
- depends on
-
DDC-1590
Fix Inheritance in Code-Generation
-