Insert/Update data in the advagg_critical_css table.
Parameters
array $records: List of rows needed that need to be changed in the db.
Return value
array Return array of booleans if anything was written to the database.
2 calls to advagg_critical_css_table_insert_update()
- advagg_critical_css_admin_settings_form_submit in advagg_critical_css/
advagg_critical_css.admin.inc - Submit callback, process the advagg_critical_css form.
- advagg_critical_css_admin_settings_form_submit_disable in advagg_critical_css/
advagg_critical_css.admin.inc - Submit callback, process the advagg_critical_css form.
File
-
advagg_critical_css/
advagg_critical_css.module, line 183
Code
function advagg_critical_css_table_insert_update(array $records) {
$return = array();
foreach ($records as $values) {
list($keys, $record) = $values;
if (!isset($record['settings'])) {
$record['settings'] = '';
}
try {
$return[] = db_merge('advagg_critical_css')->key(array(
'theme' => $keys['theme'],
'user' => $keys['user'],
'type' => $keys['type'],
'lookup' => $keys['lookup'],
))
->fields($record)
->execute();
} catch (PDOException $e) {
// Log the error if in development mode.
if (variable_get('advagg_cache_level', ADVAGG_CACHE_LEVEL) < 0) {
watchdog('advagg_critical_css', 'Development Mode - Caught PDO Exception: <code>@info</code>', array(
'@info' => $e,
));
}
}
}
return $return;
}