<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.7 |
+ | CiviCRM version 5 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2018 |
+--------------------------------------------------------------------+
*
* @param $componentIDs
* @param string $tableName
- *
+ * @param string $idField
* @return array
*/
- public static function &getContactIDsFromComponent(&$componentIDs, $tableName) {
+ public static function getContactIDsFromComponent($componentIDs, $tableName, $idField = 'id') {
$contactIDs = array();
if (empty($componentIDs)) {
$query = "
SELECT contact_id
FROM $tableName
- WHERE id IN ( $IDs )
+ WHERE $idField IN ( $IDs )
";
$dao = CRM_Core_DAO::executeQuery($query);