[FLOW3-general] inheritance and repositories
Mathis Hoffmann
mathis at hoffpost.de
Fri Apr 5 23:30:19 CEST 2013
Hey Steffen,
thank you for your quick reply!
I just tried out your solution but it doesn't work for me. Did you maybe
mark your AbstractAssignment as an entity? Marking Customer as an entity
would not make sense for me because Doctrine would create a table that
will never be filled with any values (because Customer is an abstract
class)..
Yours
Mathis
---
Mathis Hoffmann
Tilsiter Straße 14
70374 Stuttgart
Telefon: 0711 / 933 018 87
Mobil: 0176 235 747 41
E-Mail: mathis at hoffpost.de
Am 05.04.2013 22:05, schrieb Steffen Wickham:
> Hi Mathis,
>
> /**
> * Repository for parties
> *
> * @Flow\Scope("singleton")
> */
> class AssignmentRepository extends \TYPO3\Flow\Persistence\Repository {
> const ENTITY_CLASSNAME = 'AFSVN\Basic\Domain\Model\AbstractAssignment';
> }
> ?>
> it's a really simple solution! I will post my repository but some
> explanation first:
>
> I'd created two concrete classes called "RefereeAssignment" and
> "ClubAssignment" which are derived from the same base class
> "AbstractAssignment". All data can be accessed by the
> "AssignmentRepository" which only consists of the following code:
>
> <?php
> namespace AFSVN\Basic\Domain\Repository;
> use TYPO3\Flow\Annotations as Flow;
>
> /**
> * Repository for parties
> *
> * @Flow\Scope("singleton")
> */
> class AssignmentRepository extends \TYPO3\Flow\Persistence\Repository {
> const ENTITY_CLASSNAME = 'AFSVN\Basic\Domain\Model\AbstractAssignment';
> }
> ?>
>
>
> So you only have to set the base class as entity for the Repository
> manually, otherwise Flow will determine the type itself.
>
> Yours
> Steffen
>
>
>
> Am 05.04.2013 21:51, schrieb Mathis Hoffmann:
>> Hi!
>>
>> I have some trouble implementing inheritance in my FLOW-app. The
>> situation is as follows: I have an abstract superclass Customer with
>> two subclasses BusinessCustomer and PrivateCustomer. Inheritance
>> itself is working as it should. What I want to achieve now is that I
>> have a CustomerRepository which enables me to list all Customers.
>> Creating such a repository and a corresponding actioncontroller ends
>> up in "No class schema found for
>> "HdM\Accounting\Domain\Model\Customer"". Does anyone have a solution
>> how that could work?
>>
>> Thank's in advance!
>> Mathis Hoffmann
>>
>>
>> _______________________________________________
>> FLOW3-general mailing list
>> FLOW3-general at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general
> _______________________________________________
> FLOW3-general mailing list
> FLOW3-general at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general
More information about the FLOW3-general
mailing list