SproutCMS

This is the code documentation for the SproutCMS project

function saveData()

Save the data, e.g. into a database, after successful validation at the
final step

Usage

null|int $MultiStepFormController->saveData ( string $table , array $sub_tables , array $extra_fields );

Arguments

  1. string $table
    The table to save the data in, e.g. 'members'
  2. array $sub_tables
    The subtables which should be used. The keys
           must match those used in the $session['data'] array. Each of the
           values is itself an array with one element. The 0-th value is the
           subtable to save the data in, and the 1st value is the column in
           that table which links to the core table,
           e.g. ['preferences' => ['member_prefs', 'member_id']]
  3. array $extra_fields
    Extra field values which should be set before
           performing the inserts. The keys are the table names, and each
           value is an array of column name to value mappings,
           e.g. ['members' => ['date_added' => Pdb::now(), ...]]

Return value

  • int
    The insert id from the newly created record,
            or null if no table is specified
  • null
    The insert id from the newly created record,
            or null if no table is specified