The dbStore()
function stores a data object in the Database for Contents.
void dbStore(string key, mixed data object)
Please note that objects that you store in the content database using dbStore()
can only be read using dbRetrieve()
, not using dbGet()
.
The following PHP code would use the named array indices age
, gender
and response
to store two response values and all responses from the AB01 scale as an array.
$data = [ 'age' => value('SD01_01'), 'gender' => value('SD02'), 'response' => valueList('AB01') ]; $person = caseSerial(); dbStore($person, $data);
The following object would then be stored in the database for content:
{ age: 19, gender: 2, response: { AB01_01 => 3, AB01_02 => 1, AB01_03 => 2, AB01_04 => 3 } }