datahandler:DB

Designed to insert / update records into the given table.

 

This datahandler works by default in CREATION mode. This means that it will insert form-data into the given table. To make it work in EDITION mode, when invoking Formidable, give the uid of the record you need to edit as the third parameter.

 

Like this:

Reference

Go to Top
path data type req def uobj description
tableNamestring
  
   The table in the database.
keyNamestring
  
   The uid column in the database.
i18n/
i18n/useboolean false  If true, the datahandler will activate the i18n logic when handling records.
i18n/defLangUidint
  
   UID for the default language; should be 0 in most of the cases.
i18n/updateChildsOnSavetodo    todo
editEntryint  
  
UID of record to edit, if any.
process/
process/beforeInsertionrunneable  
  
Alters the array of data, before insertion into the database.
  • Input: the data array,
  • Output: the altered data array.
process/afterInsertionrunneable  
  
Alters the array of data, after insertion into the database.
  • Input: the data array,
  • Output: the altered data array.
process/beforeEditionrunneable  
  
Alters the array of data, before insertion into the database, only if the record already exists in the database.
  • Input: the data array,
  • Output: the altered data array.
process/afterEditionrunneable  
  
Alters the array of data, after insertion into the database, only if the record already exists in the database.
  • Input: the data array,
  • Output: the altered data array.
process/beforeCreationrunneable  
  
Alters the array of data, before insertion into the database, only if the record don't exists in the database and is about to be created.
  • Input: the data array,
  • Output: the altered data array.
process/afterCreationrunneable  
  
Alters the array of data, after insertion into the database, only if the record has just been created.
  • Input: the data array,
  • Output: the altered data array.

Examples

Go to Top