Skip to content

Instantly share code, notes, and snippets.

@dirceu
Created August 16, 2010 17:23
Show Gist options
  • Save dirceu/527337 to your computer and use it in GitHub Desktop.
Save dirceu/527337 to your computer and use it in GitHub Desktop.
<?php
/**
* Archive jobs after the end date
*
* @return void
* @access private
* @since 2.0
*/
private function _archiveJobs()
{
$end_date = strtotime('-30 days');
$this->db->setQuery('SELECT * FROM `#__jobline_jobs` WHERE `published` = 1');
$items = $this->db->loadObjectList();
foreach($items as $item) {
if(strtotime($item->start_date) < $end_date) {
$this->db->setQuery('UPDATE `#__jobline_jobs` SET `published` = 0 WHERE `id` = '.$item->id);
$this->db->query();
}
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment