The null array static is a work-around for pass-by-reference signatures but the executeQuery no longer requires it.
It's not actually 'just' tidy-up as the array can become contaminated, leading to hard to diagnose bugs.
Note there is one instance of a similar tidy up on contribution::create in this - the parameter is no longer mandatory & we call this function so often I feel confident about removing the stray & too
WHERE ( object_table IN ( 'civicrm_saved_search', 'civicrm_uf_group', 'civicrm_custom_group', 'civicrm_event' ) )
ORDER BY entity_id
";
- $dao = CRM_Core_DAO::executeQuery($query,
- CRM_Core_DAO::$_nullArray
- );
+ $dao = CRM_Core_DAO::executeQuery($query);
$roles = CRM_Core_OptionGroup::values('acl_role');
WHERE ( object_table NOT IN ( 'civicrm_saved_search', 'civicrm_uf_group', 'civicrm_custom_group' ) )
ORDER BY entity_id
";
- $dao = CRM_Core_DAO::executeQuery($query,
- CRM_Core_DAO::$_nullArray
- );
+ $dao = CRM_Core_DAO::executeQuery($query);
$roles = CRM_Core_OptionGroup::values('acl_role');
LEFT JOIN civicrm_option_value ov ON (at.activity_type_id = ov.value AND og.id = ov.option_group_id )
WHERE at.id IN ( $activityIDs )";
- $dao = CRM_Core_DAO::executeQuery($query,
- CRM_Core_DAO::$_nullArray
- );
+ $dao = CRM_Core_DAO::executeQuery($query);
while ($dao->fetch()) {
$rows[] = array(
if ($params['is_default']) {
$query = "UPDATE civicrm_location_type SET is_default = 0";
- CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ CRM_Core_DAO::executeQuery($query);
}
if ($this->_action & CRM_Core_Action::UPDATE) {
if (!empty($values['is_default'])) {
$query = "UPDATE civicrm_payment_processor SET is_default = 0 WHERE domain_id = $domainID";
- CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ CRM_Core_DAO::executeQuery($query);
}
$this->updatePaymentProcessor($values, $domainID, FALSE);
if (!empty($values['is_default'])) {
$query = "
UPDATE civicrm_payment_processor SET is_default = 0";
- CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ CRM_Core_DAO::executeQuery($query);
}
$dao = new CRM_Financial_DAO_PaymentProcessorType();
if ($params['is_default']) {
$query = "UPDATE civicrm_print_label SET is_default = 0";
- CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ CRM_Core_DAO::executeQuery($query);
}
$printLabel->save();
if (!empty($params['is_default'])) {
$query = "UPDATE civicrm_survey SET is_default = 0";
- CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ CRM_Core_DAO::executeQuery($query);
}
if (!(CRM_Utils_Array::value('id', $params))) {
WHERE is_deleted = 0 AND cc.contact_id IN (SELECT id FROM civicrm_contact WHERE is_deleted <> 1)
{$myCaseWhereClause} {$myGroupByClause}";
- $res = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ $res = CRM_Core_DAO::executeQuery($query);
while ($res->fetch()) {
if (!empty($rows[$res->case_type]) && !empty($rows[$res->case_type][$res->case_status])) {
$rows[$res->case_type][$res->case_status]['count'] = $rows[$res->case_type][$res->case_status]['count'] + 1;
$query = self::getCaseActivityQuery($type, $userID, $condition, $cases['case_deleted']);
- $res = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ $res = CRM_Core_DAO::executeQuery($query);
$activityInfo = array();
while ($res->fetch()) {
$from = ' FROM ' . $tableName;
$where = " WHERE {$tableName}.entity_id = {$otherCaseId}";
$query = $insert . $select . $from . $where;
- $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ $dao = CRM_Core_DAO::executeQuery($query);
}
}
LEFT JOIN civicrm_option_value ov ON (cs.status_id = ov.value AND ov.option_group_id = {$statusId} )
WHERE cs.id IN ( {$caseIDs} )";
- $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ $dao = CRM_Core_DAO::executeQuery($query);
while ($dao->fetch()) {
$rows[] = array(
'display_name' => $dao->display_name,
UPDATE civicrm_contact
SET image_URL=NULL
WHERE id={$id}; ";
- CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ CRM_Core_DAO::executeQuery($query);
return TRUE;
}
UNION
( SELECT location_type_id FROM civicrm_address WHERE contact_id = {$contactId} )
";
- $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ $dao = CRM_Core_DAO::executeQuery($query);
return $dao->N;
}
SET organization_name=NULL, employer_id = NULL
WHERE employer_id={$employerId}; ";
- $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ $dao = CRM_Core_DAO::executeQuery($query);
}
/**
WHERE id IN ( {$contacts} )
";
- $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ $dao = CRM_Core_DAO::executeQuery($query);
$currentEmployer = array();
while ($dao->fetch()) {
$currentEmployer[$dao->id]['org_id'] = $dao->employer_id;
else {
$query = "UPDATE civicrm_msg_template SET pdf_format_id = NULL WHERE id = {$formValues['template']}";
}
- CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ CRM_Core_DAO::executeQuery($query);
}
if (!empty($formValues['update_format'])) {
$bao = new CRM_Core_BAO_PdfFormat();
$additionalWhere
GROUP BY currency
";
- $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ $dao = CRM_Core_DAO::executeQuery($query);
$count = 0;
$amount = $average = array();
while ($dao->fetch()) {
WHERE contribution_recur_id IN ( {$recurID}) AND is_test = 0
GROUP BY contribution_recur_id";
- $res = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ $res = CRM_Core_DAO::executeQuery($query);
while ($res->fetch()) {
$totalCount[$res->contribution_recur_id] = $res->commpleted;
$from = ' FROM ' . $tableName;
$where = " WHERE {$tableName}.entity_id = {$sourceContributionId}";
$query = $insert . $select . $from . $where;
- CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ CRM_Core_DAO::executeQuery($query);
}
}
}
// clear other default if this is the new default label format
if ($values['is_default']) {
$query = "UPDATE civicrm_option_value SET is_default = 0 WHERE option_group_id = $group_id";
- CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ CRM_Core_DAO::executeQuery($query);
}
if ($id) {
// fetch existing record
$locationType->copyValues($params);
if (!empty($params['is_default'])) {
$query = "UPDATE civicrm_location_type SET is_default = 0";
- CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ CRM_Core_DAO::executeQuery($query);
}
$locationType->save();
// clear other default if this is the new default Paper Size
if ($values['is_default']) {
$query = "UPDATE civicrm_option_value SET is_default = 0 WHERE option_group_id = $group_id";
- CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ CRM_Core_DAO::executeQuery($query);
}
if ($id) {
// fetch existing record
// clear other default if this is the new default PDF Page Format
if ($values['is_default']) {
$query = "UPDATE civicrm_option_value SET is_default = 0 WHERE option_group_id = $group_id";
- CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ CRM_Core_DAO::executeQuery($query);
}
if ($id) {
// fetch existing record
$tags = $tagSets = array();
// first get all the tag sets
$query = "SELECT id FROM civicrm_tag WHERE is_tagset=1 AND parent_id IS NULL";
- $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ $dao = CRM_Core_DAO::executeQuery($query);
while ($dao->fetch()) {
$tagSets[] = $dao->id;
}
FROM civicrm_state_province
WHERE LOWER(name) = '$fieldStateProvince'
OR abbreviation = '$fieldStateProvince'";
- $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ $dao = CRM_Core_DAO::executeQuery($query);
if ($dao->fetch()) {
$params['default_value'] = $dao->id;
}
FROM civicrm_country
WHERE LOWER(name) = '$fieldCountry'
OR iso_code = '$fieldCountry'";
- $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ $dao = CRM_Core_DAO::executeQuery($query);
if ($dao->fetch()) {
$params['default_value'] = $dao->id;
}
2 => array($id, 'integer'),
);
- CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ CRM_Core_DAO::executeQuery($query);
}
// price set cleanup, CRM-5527
$from = ' FROM ' . $tableName;
$where = " WHERE {$tableName}.entity_id = {$id}";
$query = $insert . $select . $from . $where;
- $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ $dao = CRM_Core_DAO::executeQuery($query);
}
}
}
LEFT JOIN civicrm_contact ON (civicrm_participant.contact_id = civicrm_contact.id)
WHERE civicrm_participant.id = {$participantId}
";
- $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ $dao = CRM_Core_DAO::executeQuery($query);
$details = array();
while ($dao->fetch()) {
LEFT JOIN civicrm_option_value cov ON cov.value = cp.role_id and cov.option_group_id = {$optionGroupId}
LEFT JOIN civicrm_event ON civicrm_event.id = cp.event_id
WHERE cp.id = {$this->_from_participant_id}";
- $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ $dao = CRM_Core_DAO::executeQuery($query);
while ($dao->fetch()) {
$details['status'] = $dao->status;
$details['role'] = $dao->role;
$contact_details = CRM_Contact_BAO_Contact::getContactDetails($contact_id);
$display_name = $contact_details[0];
$query = "select event_id from civicrm_participant where contact_id = " . $contact_id;
- $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ $dao = CRM_Core_DAO::executeQuery($query);
while ($dao->fetch()) {
$to_event_id[] = $dao->event_id;
}
$params = $this->controller->exportValues($this->_name);
//cancel 'from' participant row
$query = "select contact_id from civicrm_email where email = '" . $params['email'] . "'";
- $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ $dao = CRM_Core_DAO::executeQuery($query);
while ($dao->fetch()) {
$contact_id = $dao->contact_id;
}
$from_participant = $params = array();
$query = "select role_id, source, fee_level, is_test, is_pay_later, fee_amount, discount_id, fee_currency,campaign_id, discount_amount from civicrm_participant where id = " . $this->_from_participant_id;
- $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ $dao = CRM_Core_DAO::executeQuery($query);
$value_to = array();
while ($dao->fetch()) {
$value_to['role_id'] = $dao->role_id;
LEFT JOIN civicrm_option_value cov ON cov.value = cp.role_id and cov.option_group_id = {$optionGroupId}
LEFT JOIN civicrm_event ON civicrm_event.id = cp.event_id
WHERE cp.id = {$this->_participant_id}";
- $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ $dao = CRM_Core_DAO::executeQuery($query);
while ($dao->fetch()) {
$details['status'] = $dao->status;
$details['role'] = $dao->role;
CRM_Utils_System::redirect($url);
}
$query = "select start_date as start, selfcancelxfer_time as time from civicrm_event where id = " . $this->_event_id;
- $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ $dao = CRM_Core_DAO::executeQuery($query);
while ($dao->fetch()) {
$time_limit = $dao->time;
$start_date = $dao->start;
INNER JOIN civicrm_contact ct ON ( p.contact_id = ct.id )
WHERE p.id IN ( $participantIDs )";
- $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ $dao = CRM_Core_DAO::executeQuery($query);
while ($dao->fetch()) {
$rows[] = array(
'display_name' => $dao->display_name,
SELECT status_id, count(id) as status_total
FROM civicrm_grant GROUP BY status_id";
- $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ $dao = CRM_Core_DAO::executeQuery($query);
$status = array();
$summary = array();
INNER JOIN civicrm_contact ct ON ( grt.contact_id = ct.id )
WHERE grt.id IN ( $grantIDs )";
- $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ $dao = CRM_Core_DAO::executeQuery($query);
while ($dao->fetch()) {
$rows[] = array(
AND civicrm_mailing_event_queue.email_id = civicrm_email.id
AND civicrm_mailing_event_queue.id = " . CRM_Utils_Type::escape($queueID, 'Integer');
- $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ $dao = CRM_Core_DAO::executeQuery($query);
$displayName = 'Unknown';
$email = 'Unknown';
AND civicrm_mailing_event_queue.email_id = civicrm_email.id
AND civicrm_mailing_event_queue.id = " . CRM_Utils_Type::escape($queueID, 'Integer');
- $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ $dao = CRM_Core_DAO::executeQuery($query);
$displayName = 'Unknown';
$email = 'Unknown';
AND visibility != 'User and User Admin Only'
AND $groupTypeCondition";
- $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ $dao = CRM_Core_DAO::executeQuery($query);
if ($dao->fetch()) {
$this->assign('groupName', $dao->title);
CRM_Utils_System::setTitle(ts('Subscribe to Mailing List - %1', array(1 => $dao->title)));
AND visibility != 'User and User Admin Only'
AND $groupTypeCondition
ORDER BY title";
- $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ $dao = CRM_Core_DAO::executeQuery($query);
$rows = array();
while ($dao->fetch()) {
$row = array();
WHERE {$where}
ORDER BY weight ASC";
- $membershipStatus = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ $membershipStatus = CRM_Core_DAO::executeQuery($query);
$hour = $minute = $second = 0;
while ($membershipStatus->fetch()) {
//CRM-18276 GROUP_CONCAT could be used with singleValueQuery and then exploded,
//but by default that truncates to 1024 characters, which causes errors with installs with lots of custom field sets
$customTables = array();
- $customTablesDAO = CRM_Core_DAO::executeQuery("SELECT table_name FROM civicrm_custom_group", CRM_Core_DAO::$_nullArray);
+ $customTablesDAO = CRM_Core_DAO::executeQuery("SELECT table_name FROM civicrm_custom_group");
while ($customTablesDAO->fetch()) {
$customTables[] = $customTablesDAO->table_name;
}
}
}
- $contribution = &CRM_Contribute_BAO_Contribution::create($params,
- CRM_Core_DAO::$_nullArray
- );
+ $contribution = CRM_Contribute_BAO_Contribution::create($params);
if (!$contribution->id) {
return FALSE;
}
$prefix = 'Automated Generated Group: ';
$query = "DELETE FROM civicrm_group where name like '%{$prefix}%'";
-CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+CRM_Core_DAO::executeQuery($query);
$numGroups = 100;
);
foreach ($tables as $t) {
$query = "DELETE FROM $t";
- CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ CRM_Core_DAO::executeQuery($query);
}
$prefix = 'Automated Mailing Gen: ';
VALUES
({$this->individual[3]}, 2, 'My Personal Civi Fundraiser', 'I''m on a mission to get all my friends and family to help support my favorite open-source civic sector CRM.', '<p>Friends and family - please help build much needed infrastructure for the civic sector by supporting my personal campaign!</p>\r\n<p><a href=\"https://civicrm.org\">You can learn more about CiviCRM here</a>.</p>\r\n<p>Then click the <strong>Contribute Now</strong> button to go to our easy-to-use online contribution form.</p>', 'Contribute Now', 1, 1, 1, 5000.00, NULL, 1);
";
- CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+ CRM_Core_DAO::executeQuery($query);
}
public function addContribution() {