[Flow] How to define targetEntity in abstractClass
Alexander Wende
a_wende at web.de
Wed Jul 23 16:23:00 CEST 2014
Hi Regine,
thanks for your reply, again.
Quote: Regine Rosewich wrote on Wed, 23 July 2014 13:05
----------------------------------------------------
> as far as I understand your idea, you want to create something which I
> would call a vector which begins with an initial revision of an object and
> points from revision to revision until the last one. The logical error you
> made is in my opinion that you tried to create a pointer/vector which is
> pointing in both directions, forward and backwards. That is from my point
> of view not necessary. I think It's enough to create a simple parent-child
> structure to get what you want.
First I'll try to explain my idea better.
The application I build should be the core of our new intranet.
The content is nearly completly maintained in a decentralized way. All users can edit pages, news and so on.
Every content should be revision-safe, so that it could switched back to a previous state.
A main feature is that the user can jump from revision to revision and can compare the different revisions.
This is why I build pointer in both directions - to make the revision browsing easy. The revision concept works but only with the page model. I was not able to implement another model e.g. news.
But now I found the problem!!!
I used
/**
* Nächste Revision
* Nicht gesetzt falls es sich um die neueste Revision handelt.
* @var \COMPANY\Revising\Domain\Model\RevisionInterface
* @ORM\OneToOne(mappedBy="previousRevision")
* @ORM\Column(nullable=true)
*/
but it has to be
/**
* Nächste Revision
* Nicht gesetzt falls es sich um die neueste Revision handelt.
* @var \COMPANY\Revising\Domain\Model\AbstractRevision
* @ORM\OneToOne(mappedBy="previousRevision")
* @ORM\Column(nullable=true)
*/
I had to use the abstract class in the @var annotation!! *HeadToDesk*
Thanks again for your input. I thought about it a long time... maybe I will refactor it later.
More information about the Flow
mailing list