function ultimate_cron_crud_save in Ultimate Cron 6
Same name and namespace in other branches
- 8 ultimate_cron.module \ultimate_cron_crud_save()
- 7 ultimate_cron.module \ultimate_cron_crud_save()
CRUD save. Also used for ctools integration.
Parameters
object $object: object to be saved ->name containing unique machine name.
Return value
boolean result of query.
1 call to ultimate_cron_crud_save()
- ultimate_cron_set_settings in ./
ultimate_cron.module - Set settings for a function.
1 string reference to 'ultimate_cron_crud_save'
- ultimate_cron_schema in ./
ultimate_cron.install - Implementation of hook_schema().
File
- ./
ultimate_cron.module, line 1147 - @todo Add filter on overview page. @todo Add log view (with graph). @todo Make proper markup for overview page. @todo Refactor drush stuff, too many intimate relations with Background Process @todo Refactor Cron % offset stuff. Too mixed up and…
Code
function ultimate_cron_crud_save($object) {
$settings = serialize($object->settings);
$result = db_query("UPDATE {ultimate_cron} SET settings = '%s' WHERE name = '%s'", $settings, $object->name);
if (db_affected_rows() === 0) {
$result = @db_query("INSERT INTO {ultimate_cron} (settings, name) VALUES('%s', '%s')", $settings, $object->name);
}
return $result;
}