CRM-20432: Change Membership status to current when related contribution payment...
[civicrm-core.git] / CRM / Logging / Schema.php
index 3d1d1cd532d273b2dba455fc9af4e8257c1446b5..4551b89a64f6bae1c2e7bb56bc9500cb755fc256 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2016                                |
+ | Copyright CiviCRM LLC (c) 2004-2017                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2016
+ * @copyright CiviCRM LLC (c) 2004-2017
  */
 class CRM_Logging_Schema {
   private $logs = array();
@@ -542,7 +542,7 @@ AND    (TABLE_NAME LIKE 'log_civicrm_%' $nonStandardTableNameString )
       }
       \Civi::$statics[__CLASS__]['columnsOf'][$table] = array();
       while ($dao->fetch()) {
-        \Civi::$statics[__CLASS__]['columnsOf'][$table][] = $dao->Field;
+        \Civi::$statics[__CLASS__]['columnsOf'][$table][] = CRM_Utils_type::escape($dao->Field, 'MysqlColumnNameOrAlias');
       }
     }
     return \Civi::$statics[__CLASS__]['columnsOf'][$table];
@@ -934,4 +934,16 @@ COLS;
     return array_intersect($tables, $this->tables);
   }
 
+  /**
+   * Retrieve missing log tables.
+   *
+   * @return array
+   */
+  public function getMissingLogTables() {
+    if ($this->tablesExist()) {
+      return array_diff($this->tables, array_keys($this->logs));
+    }
+    return array();
+  }
+
 }