[TYPO3-team-core-v5] RFC: fluent interface to query persistence
Karsten Dambekalns
karsten at typo3.org
Tue Jul 22 15:22:41 CEST 2008
Hi again.
Sebastian Kurfürst wrote:
>> // create a query for Post instances
>> $query = $this->queryFactory->create('F3_Blog_Domain_Post');
>> // title or content must contain FLOW3
>> $posts = $query
>> ->matching('title', '~', '%FLOW3%')
>> ->orMatching('content', '~', '%FLOW3%')
>> ->execute();
In this case "title or content", nothing more.
> We would need a precedence here - so what is the difference between:
Probably no useful difference. You need to specify precedence by
correctly nesting yourself (as in my other example).
> I still do not like the many $op's inside, but I think the query is
> easier to read than your examples.
Basically the variable and method names are shorter, no?
Regards,
Karsten
More information about the TYPO3-team-core-v5
mailing list