[Typo3-dev] tstamp

Martin Kutschker Martin.Kutschker at n0spam-blackbox.net
Fri Nov 25 17:22:40 CET 2005


Elmar Hinz schrieb:
> Dmitry Dulepov wrote:
> 
>> Hi!
>>
>> Elmar Hinz wrote:
>>
>>> is there any guidline about proper usage of the tstamp field in the
>>> tables available.
>>
>> Yes. Read Typo3 Core APIs, about "ctrl" section of TCA.
>>
>> Dmitry.
> 
> 
> Thank you Dmitry,
> 
> good documentation, but doesn't tell all. It tells that tstamp is set 
> "automatically" on each record update.
> 
> The "Project Coding Guidlines"
> 
> http://typo3.org/documentation/document-library/doc_core_cgl/Using_the_wrapper_cl/ 
> 
> 
> propose usage of MySQL wrapper functions. Example.
> 
> // INSERT:
> $insertArray = array(
>     'pid' => 123,
>     'title' => "My Title"
> );
> 
> $res = $GLOBALS['TYPO3_DB']->exec_INSERTquery('mytable', $insertArray);
> 
> How does this correlate. Don't I have to set tstamp, crdate, ( cruser_id 
> ) in this query? Is it added by DB-Layer automatically?

No. The TCE functions (for BE forms) do this.

There is no equivalent for enableFields(), which returns the necessary 
WHERE-clause part for access control (in FE), that returns the necessary 
SET parts for an UPDATE statement. Note that all (?) TYPO3 functions for 
UPDATE take arrays as arguments, so such function should rather return 
an array than a "field1=foo,field2=bar" string.

Masi




More information about the TYPO3-dev mailing list