X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FReference%2FDynamic.php;h=6c5ba398ca1eb040e038c91abe40dec90f184e2e;hb=758eba6812e4d76ebb41f40659af438aebcb25cf;hp=3f8f6d6c1bf762211ac809af1233a56513195dec;hpb=a922142c067998cb0ffb4cbc95a71aa370ffdc88;p=civicrm-core.git diff --git a/CRM/Core/Reference/Dynamic.php b/CRM/Core/Reference/Dynamic.php index 3f8f6d6c1b..6c5ba398ca 100644 --- a/CRM/Core/Reference/Dynamic.php +++ b/CRM/Core/Reference/Dynamic.php @@ -17,7 +17,7 @@ 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. @@ -28,12 +28,12 @@ class CRM_Core_Reference_Dynamic extends CRM_Core_Reference_Basic { $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();" - 2 => array($targetDao::getTableName(), 'String'), - ); + 2 => [$targetDao::getTableName(), 'String'], + ]; $sql = <<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();" - 2 => array($targetDao::getTableName(), 'String'), - ); + 2 => [$targetDao::getTableName(), 'String'], + ]; $sql = <<getReferenceKey()} = %1 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(), 'count' => CRM_Core_DAO::singleValueQuery($sql, $params), - ); + ]; } }