validation - Symfony / Doctrine: add annotiation to Attribute defined in 'MappedSuperclass' -
edit: learned, there's annotiation missing subclass ('here it's id', thx greenleaf). actual problem is, don't know, how override this, can't work.
original:
i migrated symfony 2.0 application symfony 2.2 , 'invalid entities'-information in dev-profiler, regarding unidirectional one-to-many-association. when using console with
php console doctrine:schema:validate
i receive 2 messages:
* association \entity\watched#reference refers inverse side field \entity\reference#id not defined association. * association \entity\watched#reference refers inverse side field \entity\reference#id not exist.
i think, wrong, because 'id' defined in superclass. app stills runs fine on old db (created symfony 2.0). classes (simplified):
code: select all
/** * @orm\mappedsuperclass * @orm\haslifecyclecallbacks */ abstract class superclassabstract { /** * @orm\id * @orm\column(type="integer") * @orm\generatedvalue(strategy="auto") */ protected $id = ""; // fields more... } /** * @orm\entity * @orm\table(name="watched") */ class watched extends superclassabstract { /** * @orm\manytoone(targetentity="reference", inversedby="id") * @orm\joincolumn(name="reference_id", referencedcolumnname="id") */ protected $reference; // fields more... } /** * @orm\entity * @orm\table(name="reference") */ class reference extends superclassabstract { // fields more... }
i must not see doctrine relational db.... thanks!
i add list reference handle other side of association.
Comments
Post a Comment