[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
Tue Nov 16 23:24:46 CET 2010


Jigal van Hemert schrieb am 16.11.2010 22:25:
> On 16-11-2010 22:01, Ernesto Baschny [cron IT] wrote:
>> * Heated discussion in the background *
>>
>> I would love to hear others opinions on that, if pro or contra throwing
>> exceptions on new methods of t3lib_db.
> 
> I was about to answer your previous post :-)
> 
> To me it's important to have a consistent API. If we add a new method
> first which behaves similar to the existing exec_SELECTgetRows() the API
> stays consistent.
> 
> Behaviour of existing classes shouldn't change between versions without
> warnings in advance. Currently exec_SELECgetRows() returns an empty
> array when there is an empty result set, but NULL when a problem occurs.
> Although it's not documented in the phpDoc header you can assume that
> extensions depend on this behaviour (how else would you distinguish
> between the two situations?)
> 
> Cleaning up the classes sounds nice, but what if a significant number of
> extensions stops working? I'd love to have a clean DB API, but changes
> in an existing API should be backwards compatible (or be done like
> deprecations).
> Anyway, this is just an opinion :-)

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? :)

Cheers,
Ernesto


More information about the TYPO3-team-core mailing list