I have a class "Offer" (MapperSuperclass) and two more classes that extend it: "PrivateOffer" and "PublicOffer".
The problem is that when I run the doctrine: generate: entities command, both the PrivateOffer and PublicOffer classes are populated with the same properties as the MappedSuperclass Offer class, as well as its getter and setter methods.
If I delete them and live them only in the class "Suggestion", "doctrine: schema: update" works well, as expected, but I need to run "doctrine: generate: entities" again so that it will crash every time my extended classes.
Why does doctrine: generate: entities duplicate all setter / getter properties and methods in both classes if they extend the MappedSupperclass?
Thanks everyone :)
OfferClass:
namespace Pro\JobBundle\Entity; use Doctrine\ORM\Mapping as ORM; class Offer { protected $name; ....more properties... }
PrivateOfferClass:
<?php namespace Pro\JobBundle\Entity; use Doctrine\ORM\Mapping as ORM; class PrivateOffer extends Offer { private $id; public function getId() { return $this->id; } }
PublicOfferClass:
<?php namespace Pro\JobBundle\Entity; use Doctrine\ORM\Mapping as ORM; class PublicOffer extends Offer { private $id; public function getId() { return $this->id; } }
source share