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 #13974 from eileenmcnaughton/array_format7
[civicrm-core.git]
/
CRM
/
Core
/
Reference
/
Dynamic.php
diff --git
a/CRM/Core/Reference/Dynamic.php
b/CRM/Core/Reference/Dynamic.php
index c33477eb3d1787ffa1fa25067c170977704b62c3..6c5ba398ca1eb040e038c91abe40dec90f184e2e 100644
(file)
--- a/
CRM/Core/Reference/Dynamic.php
+++ b/
CRM/Core/Reference/Dynamic.php
@@
-17,22
+17,23
@@
class CRM_Core_Reference_Dynamic extends CRM_Core_Reference_Basic {
}
/**
}
/**
- * Create a query to find references to a particular record
+ * Create a query to find references to a particular record
.
*
*
- * @param CRM_Core_DAO $targetDao the instance for which we want references
- * @return CRM_Core_DAO a query-handle (like the result of CRM_Core_DAO::executeQuery)
+ * @param CRM_Core_DAO $targetDao
+ * The instance for which we want references.
+ * @return CRM_Core_DAO
+ * a query-handle (like the result of CRM_Core_DAO::executeQuery)
*/
public function findReferences($targetDao) {
$refColumn = $this->getReferenceKey();
$targetColumn = $this->getTargetKey();
*/
public function findReferences($targetDao) {
$refColumn = $this->getReferenceKey();
$targetColumn = $this->getTargetKey();
- $params = array(
- 1 => array($targetDao->$targetColumn, 'String'),
-
+ $params = [
+ 1 => [$targetDao->$targetColumn, 'String'],
// If anyone complains about $targetDao::getTableName(), then could use
// "{get_class($targetDao)}::getTableName();"
// If anyone complains about $targetDao::getTableName(), then could use
// "{get_class($targetDao)}::getTableName();"
- 2 =>
array($targetDao::getTableName(), 'String')
,
-
)
;
+ 2 =>
[$targetDao::getTableName(), 'String']
,
+
]
;
$sql = <<<EOS
SELECT id
$sql = <<<EOS
SELECT id
@@
-53,13
+54,12
@@
EOS;
*/
public function getReferenceCount($targetDao) {
$targetColumn = $this->getTargetKey();
*/
public function getReferenceCount($targetDao) {
$targetColumn = $this->getTargetKey();
- $params = array(
- 1 => array($targetDao->$targetColumn, 'String'),
-
+ $params = [
+ 1 => [$targetDao->$targetColumn, 'String'],
// If anyone complains about $targetDao::getTableName(), then could use
// "{get_class($targetDao)}::getTableName();"
// If anyone complains about $targetDao::getTableName(), then could use
// "{get_class($targetDao)}::getTableName();"
- 2 =>
array($targetDao::getTableName(), 'String')
,
-
)
;
+ 2 =>
[$targetDao::getTableName(), 'String']
,
+
]
;
$sql = <<<EOS
SELECT count(id)
$sql = <<<EOS
SELECT count(id)
@@
-68,13
+68,13
@@
WHERE {$this->getReferenceKey()} = %1
AND {$this->getTypeColumn()} = %2
EOS;
AND {$this->getTypeColumn()} = %2
EOS;
- return
array(
- 'name' => implode(':',
array('sql', $this->getReferenceTable(), $this->getReferenceKey())
),
+ return
[
+ 'name' => implode(':',
['sql', $this->getReferenceTable(), $this->getReferenceKey()]
),
'type' => get_class($this),
'table' => $this->getReferenceTable(),
'key' => $this->getReferenceKey(),
'type' => get_class($this),
'table' => $this->getReferenceTable(),
'key' => $this->getReferenceKey(),
- 'count' => CRM_Core_DAO::singleValueQuery($sql, $params)
-
)
;
+ 'count' => CRM_Core_DAO::singleValueQuery($sql, $params)
,
+
]
;
}
}
}
}