[TYPO3-mvc] $query->contains: Is there something like $query->containsNone('fieldName')?
Jochen Rau
jochen.rau at typoplanet.de
Mon Mar 15 15:27:30 CET 2010
Hi Roberto.
On 15.03.10 15:13, roberto blanko wrote:
>>
>> After another discussion with Karsten today we came to the result that
>>
>> $query->isEmpty('categories')
>>
>> would fit. It should behave like
>>
>> if (count($categories) === 0)
>>
>> and not like
>>
>> if (empty($categories))
>>
>
> I'm okay with that. But if you take this way, ifEmpty should also work with
> non-relational fields e.g. empty strings. Otherwise it would be confusing.
That's already covered by
$query->equals('name', '')
Maybe it makes sense to cover that with isEmpty(), too. But
$query->isEmpty('age')
as a synonym for
$query->equals('age', 0)
is not what we should implement. I am not a friend of type casting in
comarisons, because the type of relation is allways known at time of
writing the method name.
Jochen
More information about the TYPO3-project-typo3v4mvc
mailing list