[TYPO3-core] RFC #11916: Feature: New TYPO3_DB method for queries that expect just a single result row

Xavier Perseguers typo3 at perseguers.ch
Sun Nov 14 16:34:18 CET 2010


Hi,

>>> comment for $numIndex was wrong. Attached is v3 which fixes this.
>> +1 by reading with two questions/remarks:
>> 1. The debug line could be copied from exec_SELECTgetRows() (three
>> lines with {})
>> 2. if $output is initialized outside the if (!$this->sql_error()), how
>> can I distinguish between an empty result set and an error? (if
>> exec_SELECTgetRows() returns NULL something must have gone wrong)
>
> Attached is v4 which fixes the issues.

I'm not OK with the change of $output as the phpDoc says it returns an 
array but in case of error, your change is back the same as v1, it 
returns an uninitialized variable. I know you did the same as in 
exec_SELECTgetRows but it's not optimal there either. I'd prefer having 
phpDoc telling us that it returns either an array or FALSE (or null) and 
then have $output initialized to FALSE (or null) before the error check.

Furthermore, second patch chunk has to be removed as it will introduce 
an empty line at end of file.

Besides that, you get my +1 by reading under previously said conditions. 
I won't review anything more before beta1. Bye.

Cheers
Xavier


More information about the TYPO3-team-core mailing list