Merge pull request #5580 from eileenmcnaughton/CRM-16247
[civicrm-core.git] / CRM / Core / ScheduledJob.php
index ec2740521061fdf208d3dc325a20b3d062e88885..6872ba2365728cabb1cc057be8a0ae83c737fea2 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  * This interface defines methods that need to be implemented
  * by every scheduled job (cron task) in CiviCRM.
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
  * $Id$
  *
  */
@@ -80,8 +80,8 @@ class CRM_Core_ScheduledJob {
    * @param null $date
    */
   public function saveLastRun($date = NULL) {
-    $dao           = new CRM_Core_DAO_Job();
-    $dao->id       = $this->id;
+    $dao = new CRM_Core_DAO_Job();
+    $dao->id = $this->id;
     $dao->last_run = ($date == NULL) ? CRM_Utils_Date::currentDBDate() : CRM_Utils_Date::currentDBDate($date);
     $dao->save();
   }
@@ -101,7 +101,7 @@ class CRM_Core_ScheduledJob {
         return TRUE;
 
       case 'Hourly':
-        $now     = CRM_Utils_Date::currentDBDate();
+        $now = CRM_Utils_Date::currentDBDate();
         $hourAgo = strtotime('-1 hour', strtotime($now));
         $lastRun = strtotime($this->last_run);
         if ($lastRun < $hourAgo) {
@@ -109,8 +109,8 @@ class CRM_Core_ScheduledJob {
         }
 
       case 'Daily':
-        $now     = CRM_Utils_Date::currentDBDate();
-        $dayAgo  = strtotime('-1 day', strtotime($now));
+        $now = CRM_Utils_Date::currentDBDate();
+        $dayAgo = strtotime('-1 day', strtotime($now));
         $lastRun = strtotime($this->last_run);
         if ($lastRun < $dayAgo) {
           return TRUE;
@@ -120,6 +120,7 @@ class CRM_Core_ScheduledJob {
     return FALSE;
   }
 
-  public function __destruct() {}
-}
+  public function __destruct() {
+  }
 
+}