Skip to content
stanistan edited this page May 24, 2011 · 2 revisions

The save array is generated by the data array of a model into a structure that is easiest to use with aql::insert and aql::update.

The Structure

array(
    'table_name' => array(
        'fields' => array(
             'field_name' => FIELD VALUE
         ),
         'id' => TABLE ID
    )
)

Ordered by foreign key dependency, so that the tables will save in the correct order.

Each table array can have subquery arrays and submodel arrays.

Difference between Save Array Structure and model::_data Structure

If the model is:

artist { 
    name
    [album]s
}

The data array will have multiple album objects (these need to be defined, as in AQL Models)

Clone this wiki locally