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

Ernesto Baschny [cron IT] ernst at cron-it.de
Wed Nov 17 14:49:28 CET 2010


Jigal van Hemert schrieb am 17.11.2010 12:52:
> Hi,
> 
> On 16-11-2010 23:24, Ernesto Baschny [cron IT] wrote:
>> No, I was not talking about changing existing API, just about throwing
>> an exception in the NEW method (which is not used anywhere yet since it
>> doesn't even exist yet). Yes or no? :)
> 
> That would form an inconsistency in the "new" API as a whole:
> exec_SELECTgetRows() : empty array for empty recordset, NULL for error
> exec_SELECTgetSingleRow() : empty array for empty recordset, exception
> for error
> (both methods have identical parameters and similar functionality,
> except for the number of rows returned)
> 
> If you add exception to all methods (which would be a clean solution)
> then others need to change their code to catch the exceptions.
> 
> So, I personally would say no to adding an exception in this method
> only. But the core devs and RMs will decide in the end :-)

As much as I like Exceptions, I agree with this reasoning.

So we add methods that have a similar API using the "known methodology".
The refactoring into a more modern way of dealing with errors is left to
a future RFC, maybe having it configurable in the TYPO3_CONF_VARS to
keep it backwards compatible.

Cheers,
Ernesto



More information about the TYPO3-team-core mailing list