[Typo3-dev] Is cObj->DBgetInsert going to be obsolete?

Elmar Hinz elmar.hinz at vcd-berlin.de
Sun Aug 14 14:10:12 CEST 2005


> Ever cared to look at the source code? I you had a look at the function 
> you would have noticed it uses (as all core functions do!) 
> $GLOBALS['TYPO3_DB'] for database access.
> 
> So you can use this function. It is currently not deprecated.

Thank you for detailed information. Certainly I could have looked at the 
sourcecode. That would have given me only a part of the answer. So I 
decided to discuss about usage and future this function instead.

It is the question about best practice, about "the official" way to do 
FE-inserts. To find the approach that will still be supported in future 
releases of typo3.

The cObj->DBgetInsert function looks very usefull for inserts, because 
it regards the "system-fields" according to $TCA. What makes me wonder 
is, that this nice function is seldom recommended in docs and books. And 
that you find it not back in the FE function collection tslib_pibase, 
while you find severel queries.

SECTION: Database, queries
pi_list_query($table,$count=0,$addWhere='',$mm_cat='',$groupBy='',$orderBy='',$query='',$returnQueryArray=FALSE)
pi_exec_query($table,$count=0,$addWhere='',$mm_cat='',$groupBy='',$orderBy='',$query='')
pi_getRecord($table,$uid,$checkPage=0)
pi_getPidList($pid_list,$recursive=0)
pi_prependFieldsWithTable($table,$fieldList)
pi_getCategoryTableContents($table,$pid,$whereClause='',$groupBy='',$orderBy='',$limit='')

There aren't any DB manipulating functions at all, only those for mere 
queries. As manipulations are the more critical task, I think it would 
support quality of FE-plugins to find an API in pi_base that ensures 
coherent DB manipulations according to $TCA.

Regards

Elmar












More information about the TYPO3-dev mailing list