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

Jigal van Hemert jigal at xs4all.nl
Tue Nov 16 22:25:14 CET 2010


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

-- 
Kind regards / met vriendelijke groet,

Jigal van Hemert
skype:jigal.van.hemert
msn: jigal at xs4all.nl
http://twitter.com/jigalvh


More information about the TYPO3-team-core mailing list