CRM-20432: Change Membership status to current when related contribution payment...
[civicrm-core.git] / CRM / Logging / Schema.php
index 0cbe435c5eb071404b5aca176b730339e41d65a8..4551b89a64f6bae1c2e7bb56bc9500cb755fc256 100644 (file)
@@ -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();
+  }
+
 }