function restful_register_shutdown_function_once in RESTful 7.2
Helper function to schedule a shutdown once.
Parameters
callable $callback: The callback.
4 calls to restful_register_shutdown_function_once()
- restful_entity_delete in ./
restful.entity.inc - Implements hook_entity_delete().
- restful_entity_update in ./
restful.entity.inc - Implements hook_entity_update().
- restful_user_delete in ./
restful.entity.inc - Implements hook_user_delete().
- restful_user_update in ./
restful.entity.inc - Implements hook_user_update().
File
- ./
restful.entity.inc, line 137 - Contains entity related code.
Code
function restful_register_shutdown_function_once($callback) {
$existing_callbacks = drupal_register_shutdown_function();
$added = (bool) array_filter($existing_callbacks, function ($item) use ($callback) {
return $item['callback'] == $callback;
});
if (!$added) {
drupal_register_shutdown_function($callback);
}
}