CRM-17028: Yearly and Monthly Repeat Reminders send on every cron for 24 hours
[civicrm-core.git] / CRM / Core / DAO.php
index d4edfff9b30ac3979129907a564c442ca4f8294d..3c5f3294b885d951b5b5ea2f07def7919108a528 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.                                    |
   |                                                                    |
@@ -29,7 +29,7 @@
  * Our base DAO class. All DAO classes should inherit from this class.
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
  * $Id$
  *
  */
@@ -977,6 +977,19 @@ FROM   civicrm_domain
     return $object;
   }
 
+  /**
+   * Returns all results as array-encoded records.
+   *
+   * @return array
+   */
+  public function fetchAll() {
+    $result = array();
+    while ($this->fetch()) {
+      $result[] = $this->toArray();
+    }
+    return $result;
+  }
+
   /**
    * Given a DAO name, a column name and a column value, find the record and GET the value of another column in that record
    *
@@ -2204,10 +2217,12 @@ SELECT contact_id
    */
   public static function buildOptionsContext($context = NULL) {
     $contexts = array(
-      'get' => "All options are returned, even if they are disabled. Labels are translated.",
-      'create' => "Options are filtered appropriately for the object being created/updated. Labels are translated.",
-      'search' => "Searchable options are returned. Labels are translated.",
-      'validate' => "All options are returned, even if they are disabled. Machine names are used in place of labels.",
+      'get' => "get: all options are returned, even if they are disabled; labels are translated.",
+      'create' => "create: options are filtered appropriately for the object being created/updated; labels are translated.",
+      'search' => "search: searchable options are returned; labels are translated.",
+      'validate' => "validate: all options are returned, even if they are disabled; machine names are used in place of labels.",
+      'abbreviate' => "abbreviate: enabled options are returned; labels are replaced with abbreviations.",
+      'match' => "match: enabled options are returned using machine names as keys; labels are translated.",
     );
     // Validation: enforce uniformity of this param
     if ($context !== NULL && !isset($contexts[$context])) {
@@ -2272,7 +2287,7 @@ SELECT contact_id
     // http://issues.civicrm.org/jira/browse/CRM-9150 - stick with 'simple' operators for now
     // support for other syntaxes is discussed in ticket but being put off for now
     foreach ($filter as $operator => $criteria) {
-      if (in_array($operator, self::acceptedSQLOperators())) {
+      if (in_array($operator, self::acceptedSQLOperators(), TRUE)) {
         switch ($operator) {
           // unary operators
           case 'IS NULL':