[TYPO3-mvc] $query->contains: Is there something like $query->containsNone('fieldName')?

Martin Kutschker masi-no at spam-typo3.org
Mon Mar 15 15:33:46 CET 2010


roberto blanko schrieb:
>> 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.

PHP's empty() is confusing. It makes sense for strings (empty string) and array (item count of
zero), but not for numbers. It should throw an exception or trigger an error in these cases.

Masi


More information about the TYPO3-project-typo3v4mvc mailing list