Created
August 16, 2010 17:23
-
-
Save dirceu/527337 to your computer and use it in GitHub Desktop.
This file contains 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 | |
/** | |
* 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