[Flow] How to define targetEntity in abstractClass
Regine Rosewich
regine.rosewich at hoellenberg.biz
Wed Jul 23 13:05:08 CEST 2014
Hi Alexander,
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.
/**
* The reference to the revision controlled Object (filled whenever a
revision
* controlled object is created)
* self-referencing
*
* @var \COMPANY\Revising\Domain\Model\RevisionInterface
* @ORM\ManyToOne(inversedBy=„revisions", fetch=„EXTRA_LAZY")
* @ORM\JoinColumn(name=„revisionControlledObject", onDelete="SET NULL")
*/
protected $revisionControlledObject;
/**
* The revisions of a revision controlled Object (already filled with the
* initial revision (revision-Number is 0) when such an object is created
* self-referencing
*
* @var \COMPANY\Revising\Domain\Model\RevisionInterface
* @ORM\OneToMany(mappedBy=„revisionControlledObject")
* @ORM\OrderBy({„revisionNumber" = "ASC"})
*/
protected $revisions;
Am 23.07.14 12:22 schrieb "Alexander Wende" unter <a_wende at web.de>:
>Quote: Karsten Dambekalns (k-fish) wrote on Tue, 22 July 2014 08:50
>----------------------------------------------------
>> You want to read about and use inheritance mapping:
>>http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/referenc
>>e/inheritance-mapping.html
>>
>
>Thanks for your reply Karsten. I knows these documentation and read it
>multiple times. But in my case I had to override the association type of
>the superclass in the concrete entity from
>
> * @ORM\OneToOne(targetEntity="\COMPANY\Page\Domain\Model\Page")
>
>to
>
> * @ORM\OneToOne(targetEntity="\COMPANY\News\Domain\Model\News")
>
>And according to the doctrine documentation, the association type cannot
>changed.
>
>Somewhere I read that it should be possible to override the targetEntity
>using the TYPO3 flow object.yaml file. But I can't find anything in the
>documentation.
>
>In extbase that is very easy because the db schema has to be created
>manually, but I have no solution for flow :(
>
>
>_______________________________________________
>Flow mailing list
>Flow at lists.typo3.org
>http://lists.typo3.org/cgi-bin/mailman/listinfo/flow
More information about the Flow
mailing list