function hook_apply_draft_changes

Allows modules to execute code when the admin user has chose to "apply draft changes".

1 function implements hook_apply_draft_changes()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

z__schools_apply_draft_changes in modules/schools/schools.module
Implements hook_apply_draft_changes

File

includes/hook.api.php, line 734
Lists all available hooks within FlightPath's core code.

Code

function hook_apply_draft_changes() {

  $table_name = "my_module_table";
  $draft_table_name = "draft_$table_name";

  // First, truncate existing...
  $query = "truncate table $table_name";
  $res = db_query($query);

  // Now, copy in draft changes...
  $query = "INSERT INTO $table_name
          SELECT * FROM $draft_table_name ";
  $res = db_query($query);


}