Created
August 29, 2014 21:12
-
-
Save arturo-c/6414cab5755512979547 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_cron_queue_info(). | |
* | |
* Define callback functions for queue items. | |
*/ | |
function pc_rel_cron_queue_info() { | |
return array( | |
'cleanup_old_guardian_relationships' => array( | |
'worker callback' => 'pc_rel_cleanup_old_guardian_relationships', | |
), | |
); | |
} | |
/** | |
* | |
*/ | |
function pc_rel_cleanup_old_guardian_relationships($data) { | |
foreach ($guardian as $guardian) { | |
//Get all the children | |
//Get all the parents for each kid | |
//Verify that the guardian to guardina relationship exists. | |
} | |
} | |
/** | |
* | |
*/ | |
function pc_rel_update_6005() { | |
// Tell drupal that you want resque to process. | |
variable_set('queue_class_cleanup_old_guardian_relationships', 'Resque'); | |
// Get all the guardinas on the site | |
while ($guardian_subset = array_slice($all_the_guardians, 500)) { | |
DrupalQueue::get(array('guardians' => $guardian_subset)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment