projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #14669 from civicrm/5.15
[civicrm-core.git]
/
CRM
/
Utils
/
SQL
/
Insert.php
diff --git
a/CRM/Utils/SQL/Insert.php
b/CRM/Utils/SQL/Insert.php
index fc8f1363583049ef5cded399acfd1190ad8ac363..816c89f605d0079eb949a02d1e2be230c31473f5 100644
(file)
--- a/
CRM/Utils/SQL/Insert.php
+++ b/
CRM/Utils/SQL/Insert.php
@@
-36,6
+36,7
@@
class CRM_Utils_SQL_Insert {
/**
* Array<string> list of column names
/**
* Array<string> list of column names
+ * @var array
*/
private $columns;
*/
private $columns;
@@
-59,10
+60,11
@@
class CRM_Utils_SQL_Insert {
*/
public static function dao(CRM_Core_DAO $dao) {
$table = CRM_Core_DAO::getLocaleTableName($dao->getTableName());
*/
public static function dao(CRM_Core_DAO $dao) {
$table = CRM_Core_DAO::getLocaleTableName($dao->getTableName());
- $row =
array()
;
+ $row =
[]
;
foreach ((array) $dao as $key => $value) {
if ($value === 'null') {
foreach ((array) $dao as $key => $value) {
if ($value === 'null') {
- $value = NULL; // Blerg!!!
+ // Blerg!!!
+ $value = NULL;
}
// Skip '_foobar' and '{\u00}*_options' and 'N'.
if (preg_match('/[a-zA-Z]/', $key{0}) && $key !== 'N') {
}
// Skip '_foobar' and '{\u00}*_options' and 'N'.
if (preg_match('/[a-zA-Z]/', $key{0}) && $key !== 'N') {
@@
-80,7
+82,7
@@
class CRM_Utils_SQL_Insert {
*/
public function __construct($table) {
$this->table = $table;
*/
public function __construct($table) {
$this->table = $table;
- $this->rows =
array()
;
+ $this->rows =
[]
;
}
/**
}
/**
@@
-128,11
+130,11
@@
class CRM_Utils_SQL_Insert {
sort($columns);
$this->columns = $columns;
}
sort($columns);
$this->columns = $columns;
}
- elseif (array_diff($this->columns, $columns) !==
array()
) {
+ elseif (array_diff($this->columns, $columns) !==
[]
) {
throw new CRM_Core_Exception("Inconsistent column names");
}
throw new CRM_Core_Exception("Inconsistent column names");
}
- $escapedRow =
array()
;
+ $escapedRow =
[]
;
foreach ($this->columns as $column) {
$escapedRow[$column] = $this->escapeString($row[$column]);
}
foreach ($this->columns as $column) {
$escapedRow[$column] = $this->escapeString($row[$column]);
}