[TYPO3-team-core-v5] RFC: fluent interface to query persistence
Karsten Dambekalns
karsten at typo3.org
Wed Jul 23 10:02:59 CEST 2008
Hi.
Christoph Koehler wrote:
>> Yes, but in my examples I had this as well:
>
>> ->matching('title', '~', '%FLOW3%')
>> ->orMatching($query
>> ->matching('content', '~', 'cool')
>> ->andMatching('title', '~', '%TYPO3')
>> )
>
>> See?
>
>
> How would you handle nested AND / OR queries? Stuff like (1 AND 2) OR
> (3 AND 4) ?
Following the syntax proposed above:
->matching($query->matching(1, =, 1)->matching(2,=,2))
->orMatching($query->matching(3, =, 3)->matching(4,=,4))
Rather clumsy, eh? :)
But I have moved away from that idea closer to something along the lines
of what Sebastian suggested mixed with some other ideas. Next up is
working on the JSR-283 Query Object Model porting and then we'll see how
we can best align both worlds.
Regards,
Karsten
More information about the TYPO3-team-core-v5
mailing list