Details
Description
I've created a symfony bundle with an entity that I want to use as a base across mutiple other entities:
/**
* @orm\Entity
* @orm\HasLifecycleCallbacks()
*/
class Base
{
/**
* @orm\Id
* @orm\Column(type="integer")
* @orm\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @orm\Column(type="string", unique="true", length="150")
*/
protected $name;
/**
* @orm\Column(type="string", unique="true", length="150")
*/
protected $username;
...
}
I have another entity in another bundle that extends this:
class Extended extends \Test\Entity\Base
When I run doctrine:generate:entites it incorrectly generates the extended class - it sets all inherited properties as 'private' which then causes PHP to raise an exception because properties on an extended class have more restrictive visibility than from the base class.
It probably shouldn't be auto-generating the properties in the extended class at all, or generating getters/setters since that then overrides my base implementation by default.
Should be fixed