[TYPO3-mvc] Extbase complex query - using joins

Patrick Schriner patrick.schriner at diemedialen.de
Thu Feb 21 11:45:37 CET 2013


Try:

$query->equals('participations.department.groupName', $groupName)

Regards,
Patrick

On Thu, 21 Feb 2013 10:22:07 +0100, Christian Mattart  
<christian.mattart.newsgroups at gmail.com> wrote:

> Hi,
>
> I am trying to write a query in order to fetch people who belong to a
> specific group.
>
> I have 4 objects:
> - Person
> - Participation
> - Department
> - Group
>
> A Person can have as many Participations as he wants.
> Each Participation is related to one Department. And every Department is
> part of a Group.
>
> I have tried the following query:
>
>   $query = $this->createQuery();
>   $query->matching(
>     $query->equals('participations.department.group_name', $groupName)
>     );
>
>   $result = $query->execute();
>
> But it fails miserably with the following:
> PHP Fatal error:  Call to a member function getParentKeyFieldName() on a
> non-object in /home/lesscouts/domains/
> test.lesscouts.be/typo3_src-4.7.5/typo3/sysext/extbase/Classes/Persistence/Storage/Typo3DbBackend.php
> on
> line 679
>
> Do you know how to solve this?
>
> Thanks for your help!


-- 
Patrick Schriner


More information about the TYPO3-project-typo3v4mvc mailing list