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

JoH asenau info at cybercraft.de
Sat Nov 13 17:53:48 CET 2010


This is an SVN patch request.

Type: Feature

Bugtracker references: http://bugs.typo3.org/view.php?id=11916

Branches: trunk

Problem:
I would like to introduce a new function exec_SELECTgetSingleRow() to prevent exec_SELECTgetRows() being used for queries that definitely expect only one row to be returned.

Just like exec_SELECTgetRows() it will contain all necessary function calls to execute the query, get the result row, free the result and return the data.

To avoid any additional function calls IMHO it should not be a variant of exec_SELECTgetRows() but another function.

This way we can get rid of exec_SELECTgetRows in case

1) list(blah) has been used with getRows (eliminates 3 useless function calls)
2) LIMIT has ben set to 1 (eliminates 2 useless function calls)
3) $result[0] has been used only (eliminates 2 useless function calls)
4) other context that used only single results

But this will be done in another RFC.

Solution:
Attached patch adds the method exec_SELECTgetSingleRow to TYPO3_DB.

Cheers

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
Xing: http://contact.cybercraft.de
Twitter: http://twitter.com/bunnyfield
TYPO3 cookbook (2nd edition): http://www.typo3experts.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 11916.diff
Type: application/octet-stream
Size: 1447 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20101113/2c3d1154/attachment.obj>


More information about the TYPO3-team-core mailing list