From e03e16417a7054d229ee8b28952afae44cd6825c Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Mon, 17 Jun 2019 14:55:11 +1000 Subject: [PATCH] Remove unneeded use of CRM_Core_DAO::$_nullArray in executeQuery or similar calls --- CRM/Contact/BAO/Contact/Utils.php | 4 +- .../Form/Search/Custom/ActivitySearch.php | 4 +- CRM/Contact/Form/Search/Custom/Base.php | 2 +- .../Search/Custom/ContributionAggregate.php | 4 +- CRM/Contact/Form/Search/Custom/DateAdded.php | 20 +++--- .../Form/Search/Custom/EventAggregate.php | 8 +-- .../Form/Search/Custom/TagContributions.php | 4 +- CRM/Contact/Page/CustomSearch.php | 4 +- CRM/Contribute/BAO/ContributionPage.php | 2 +- CRM/Contribute/Form/AbstractEditPayment.php | 4 +- .../Form/Task/SearchTaskHookSample.php | 4 +- CRM/Contribute/Form/Task/Status.php | 12 +--- CRM/Core/BAO/CustomField.php | 4 +- CRM/Financial/Form/FinancialAccount.php | 2 +- CRM/Logging/Schema.php | 8 +-- CRM/Member/BAO/Membership.php | 4 +- CRM/Member/BAO/MembershipStatus.php | 4 +- CRM/Upgrade/Form.php | 4 +- CRM/Upgrade/Incremental/php/FourFive.php | 2 +- CRM/Upgrade/Incremental/php/FourThree.php | 2 +- sql/GenerateReportData.php | 66 +++++++++---------- 21 files changed, 67 insertions(+), 101 deletions(-) diff --git a/CRM/Contact/BAO/Contact/Utils.php b/CRM/Contact/BAO/Contact/Utils.php index a839ce5626e..8850d9acc50 100644 --- a/CRM/Contact/BAO/Contact/Utils.php +++ b/CRM/Contact/BAO/Contact/Utils.php @@ -132,9 +132,7 @@ public static function checkContactType(&$contactIds) { FROM civicrm_contact WHERE id IN ( $idString ) "; - $count = CRM_Core_DAO::singleValueQuery($query, - CRM_Core_DAO::$_nullArray - ); + $count = CRM_Core_DAO::singleValueQuery($query); return $count > 1 ? TRUE : FALSE; } diff --git a/CRM/Contact/Form/Search/Custom/ActivitySearch.php b/CRM/Contact/Form/Search/Custom/ActivitySearch.php index afda78618c2..30d95f18476 100644 --- a/CRM/Contact/Form/Search/Custom/ActivitySearch.php +++ b/CRM/Contact/Form/Search/Custom/ActivitySearch.php @@ -368,9 +368,7 @@ public function where($includeContactIDs = FALSE) { public function count() { $sql = $this->all(); - $dao = CRM_Core_DAO::executeQuery($sql, - CRM_Core_DAO::$_nullArray - ); + $dao = CRM_Core_DAO::executeQuery($sql); return $dao->N; } diff --git a/CRM/Contact/Form/Search/Custom/Base.php b/CRM/Contact/Form/Search/Custom/Base.php index b4edd5986d4..9baf5429b3e 100644 --- a/CRM/Contact/Form/Search/Custom/Base.php +++ b/CRM/Contact/Form/Search/Custom/Base.php @@ -95,7 +95,7 @@ public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL return $sql; } - return CRM_Core_DAO::composeQuery($sql, CRM_Core_DAO::$_nullArray); + return CRM_Core_DAO::composeQuery($sql); } /** diff --git a/CRM/Contact/Form/Search/Custom/ContributionAggregate.php b/CRM/Contact/Form/Search/Custom/ContributionAggregate.php index df9d090461b..5437e0d2a02 100644 --- a/CRM/Contact/Form/Search/Custom/ContributionAggregate.php +++ b/CRM/Contact/Form/Search/Custom/ContributionAggregate.php @@ -301,9 +301,7 @@ public function having($includeContactIDs = FALSE) { public function count() { $sql = $this->all(); - $dao = CRM_Core_DAO::executeQuery($sql, - CRM_Core_DAO::$_nullArray - ); + $dao = CRM_Core_DAO::executeQuery($sql); return $dao->N; } diff --git a/CRM/Contact/Form/Search/Custom/DateAdded.php b/CRM/Contact/Form/Search/Custom/DateAdded.php index f3be4f2e2d9..12b3a03e54f 100644 --- a/CRM/Contact/Form/Search/Custom/DateAdded.php +++ b/CRM/Contact/Form/Search/Custom/DateAdded.php @@ -211,7 +211,7 @@ public function from() { date_added >= '$startDate 00:00:00' $endDateFix"; - CRM_Core_DAO::executeQuery($dateRange, CRM_Core_DAO::$_nullArray); + CRM_Core_DAO::executeQuery($dateRange); // Only include groups in the search query of one or more Include OR Exclude groups has been selected. // CRM-6356 @@ -256,7 +256,7 @@ public function from() { civicrm_group_contact.status = 'Added' AND civicrm_group_contact.group_id IN( {$xGroups})"; - CRM_Core_DAO::executeQuery($excludeGroup, CRM_Core_DAO::$_nullArray); + CRM_Core_DAO::executeQuery($excludeGroup); //search for smart group contacts foreach ($this->_excludeGroups as $keys => $values) { @@ -271,7 +271,7 @@ public function from() { $smartGroupQuery = " INSERT IGNORE INTO {$this->_xgTable}(contact_id) $smartSql"; - CRM_Core_DAO::executeQuery($smartGroupQuery, CRM_Core_DAO::$_nullArray); + CRM_Core_DAO::executeQuery($smartGroupQuery); } } } @@ -303,7 +303,7 @@ public function from() { $includeGroup .= " AND {$this->_xgTable}.contact_id IS null"; } - CRM_Core_DAO::executeQuery($includeGroup, CRM_Core_DAO::$_nullArray); + CRM_Core_DAO::executeQuery($includeGroup); //search for smart group contacts foreach ($this->_includeGroups as $keys => $values) { @@ -330,13 +330,13 @@ public function from() { {$this->_igTable}(contact_id) $smartSql"; - CRM_Core_DAO::executeQuery($smartGroupQuery, CRM_Core_DAO::$_nullArray); + CRM_Core_DAO::executeQuery($smartGroupQuery); $insertGroupNameQuery = "UPDATE IGNORE {$this->_igTable} SET group_names = (SELECT title FROM civicrm_group WHERE civicrm_group.id = $values) WHERE {$this->_igTable}.contact_id IS NOT NULL AND {$this->_igTable}.group_names IS NULL"; - CRM_Core_DAO::executeQuery($insertGroupNameQuery, CRM_Core_DAO::$_nullArray); + CRM_Core_DAO::executeQuery($insertGroupNameQuery); } } } @@ -395,9 +395,7 @@ public function setTitle($title) { public function count() { $sql = $this->all(); - $dao = CRM_Core_DAO::executeQuery($sql, - CRM_Core_DAO::$_nullArray - ); + $dao = CRM_Core_DAO::executeQuery($sql); return $dao->N; } @@ -405,12 +403,12 @@ public function __destruct() { //drop the temp. tables if they exist if ($this->_igTable && !empty($this->_includeGroups)) { $sql = "DROP TEMPORARY TABLE IF EXISTS {$this->_igTable}"; - CRM_Core_DAO::executeQuery($sql, CRM_Core_DAO::$_nullArray); + CRM_Core_DAO::executeQuery($sql); } if ($this->_xgTable && !empty($this->_excludeGroups)) { $sql = "DROP TEMPORARY TABLE IF EXISTS {$this->_xgTable}"; - CRM_Core_DAO::executeQuery($sql, CRM_Core_DAO::$_nullArray); + CRM_Core_DAO::executeQuery($sql); } } diff --git a/CRM/Contact/Form/Search/Custom/EventAggregate.php b/CRM/Contact/Form/Search/Custom/EventAggregate.php index 441688dab65..e3b36fc95dc 100644 --- a/CRM/Contact/Form/Search/Custom/EventAggregate.php +++ b/CRM/Contact/Form/Search/Custom/EventAggregate.php @@ -306,9 +306,7 @@ public function summary() { WHERE $where "; - $dao = CRM_Core_DAO::executeQuery($sql, - CRM_Core_DAO::$_nullArray - ); + $dao = CRM_Core_DAO::executeQuery($sql); $totals = []; while ($dao->fetch()) { $totals['payment_amount'] = $dao->payment_amount; @@ -329,9 +327,7 @@ public function summary() { public function count() { $sql = $this->all(); - $dao = CRM_Core_DAO::executeQuery($sql, - CRM_Core_DAO::$_nullArray - ); + $dao = CRM_Core_DAO::executeQuery($sql); return $dao->N; } diff --git a/CRM/Contact/Form/Search/Custom/TagContributions.php b/CRM/Contact/Form/Search/Custom/TagContributions.php index df0e60488fe..d6bd1b17d8e 100644 --- a/CRM/Contact/Form/Search/Custom/TagContributions.php +++ b/CRM/Contact/Form/Search/Custom/TagContributions.php @@ -229,9 +229,7 @@ public function where($includeContactIDs = FALSE) { public function count() { $sql = $this->all(); - $dao = CRM_Core_DAO::executeQuery($sql, - CRM_Core_DAO::$_nullArray - ); + $dao = CRM_Core_DAO::executeQuery($sql); return $dao->N; } diff --git a/CRM/Contact/Page/CustomSearch.php b/CRM/Contact/Page/CustomSearch.php index 15b313f2318..0ee1969f915 100644 --- a/CRM/Contact/Page/CustomSearch.php +++ b/CRM/Contact/Page/CustomSearch.php @@ -56,9 +56,7 @@ public static function &info() { AND v.is_active = 1 ORDER By v.weight "; - $dao = CRM_Core_DAO::executeQuery($sql, - CRM_Core_DAO::$_nullArray - ); + $dao = CRM_Core_DAO::executeQuery($sql); $rows = []; while ($dao->fetch()) { diff --git a/CRM/Contribute/BAO/ContributionPage.php b/CRM/Contribute/BAO/ContributionPage.php index fa6c55592e3..164ab946ab2 100644 --- a/CRM/Contribute/BAO/ContributionPage.php +++ b/CRM/Contribute/BAO/ContributionPage.php @@ -734,7 +734,7 @@ public static function copy($id) { WHERE entity_table = 'civicrm_contribution_page' AND entity_id ={$id}"; - $premiumDao = CRM_Core_DAO::executeQuery($premiumQuery, CRM_Core_DAO::$_nullArray); + $premiumDao = CRM_Core_DAO::executeQuery($premiumQuery); while ($premiumDao->fetch()) { if ($premiumDao->id) { CRM_Core_DAO::copyGeneric('CRM_Contribute_DAO_PremiumsProduct', [ diff --git a/CRM/Contribute/Form/AbstractEditPayment.php b/CRM/Contribute/Form/AbstractEditPayment.php index 196a0c348ba..8da1c12557a 100644 --- a/CRM/Contribute/Form/AbstractEditPayment.php +++ b/CRM/Contribute/Form/AbstractEditPayment.php @@ -338,9 +338,7 @@ public function assignPremiumProduct($id) { FROM civicrm_contribution_product WHERE contribution_id = {$id} "; - $dao = CRM_Core_DAO::executeQuery($sql, - CRM_Core_DAO::$_nullArray - ); + $dao = CRM_Core_DAO::executeQuery($sql); if ($dao->fetch()) { $this->_premiumID = $dao->id; $this->_productDAO = $dao; diff --git a/CRM/Contribute/Form/Task/SearchTaskHookSample.php b/CRM/Contribute/Form/Task/SearchTaskHookSample.php index 6c84b5315d1..81a3f827df1 100644 --- a/CRM/Contribute/Form/Task/SearchTaskHookSample.php +++ b/CRM/Contribute/Form/Task/SearchTaskHookSample.php @@ -55,9 +55,7 @@ public function preProcess() { INNER JOIN civicrm_contact ct ON ( co.contact_id = ct.id ) WHERE co.id IN ( $contribIDs )"; - $dao = CRM_Core_DAO::executeQuery($query, - CRM_Core_DAO::$_nullArray - ); + $dao = CRM_Core_DAO::executeQuery($query); while ($dao->fetch()) { $rows[] = [ diff --git a/CRM/Contribute/Form/Task/Status.php b/CRM/Contribute/Form/Task/Status.php index bc291dc167b..388362b05ce 100644 --- a/CRM/Contribute/Form/Task/Status.php +++ b/CRM/Contribute/Form/Task/Status.php @@ -70,9 +70,7 @@ public function preProcess() { FROM civicrm_contribution WHERE contribution_status_id != 2 AND {$this->_componentClause}"; - $count = CRM_Core_DAO::singleValueQuery($query, - CRM_Core_DAO::$_nullArray - ); + $count = CRM_Core_DAO::singleValueQuery($query); if ($count != 0) { CRM_Core_Error::statusBounce(ts('Please select only online contributions with Pending status.')); } @@ -110,9 +108,7 @@ public function buildQuickForm() { civicrm_contribution co WHERE co.contact_id = c.id AND co.id IN ( $contribIDs )"; - $dao = CRM_Core_DAO::executeQuery($query, - CRM_Core_DAO::$_nullArray - ); + $dao = CRM_Core_DAO::executeQuery($query); // build a row for each contribution id $this->_rows = []; @@ -323,9 +319,7 @@ public static function &getDetails($contributionIDs) { WHERE c.id IN ( $contributionIDs )"; $rows = []; - $dao = CRM_Core_DAO::executeQuery($query, - CRM_Core_DAO::$_nullArray - ); + $dao = CRM_Core_DAO::executeQuery($query); while ($dao->fetch()) { $rows[$dao->contribution_id]['component'] = $dao->participant_id ? 'event' : 'contribute'; diff --git a/CRM/Core/BAO/CustomField.php b/CRM/Core/BAO/CustomField.php index dcfda0e64bf..36391dba093 100644 --- a/CRM/Core/BAO/CustomField.php +++ b/CRM/Core/BAO/CustomField.php @@ -1945,9 +1945,7 @@ public static function _moveFieldValidate($fieldID, $newGroupID) { FROM $tableName WHERE $columnName is not null "; - $count = CRM_Core_DAO::singleValueQuery($query, - CRM_Core_DAO::$_nullArray - ); + $count = CRM_Core_DAO::singleValueQuery($query); if ($count > 0) { $query = " SELECT extends diff --git a/CRM/Financial/Form/FinancialAccount.php b/CRM/Financial/Form/FinancialAccount.php index f304e7fcfa8..227e6d01432 100644 --- a/CRM/Financial/Form/FinancialAccount.php +++ b/CRM/Financial/Form/FinancialAccount.php @@ -53,7 +53,7 @@ public function preProcess() { $params = [ 'id' => $this->_id, ]; - $financialAccount = CRM_Financial_BAO_FinancialAccount::retrieve($params, CRM_Core_DAO::$_nullArray); + $financialAccount = CRM_Financial_BAO_FinancialAccount::retrieve($params); $financialAccountTypeId = key(CRM_Core_PseudoConstant::accountOptionValues('financial_account_type', NULL, " AND v.name LIKE 'Asset' ")); if ($financialAccount->financial_account_type_id == $financialAccountTypeId && strtolower($financialAccount->account_type_code) == 'ar' diff --git a/CRM/Logging/Schema.php b/CRM/Logging/Schema.php index 9ce4883b181..858c693813a 100644 --- a/CRM/Logging/Schema.php +++ b/CRM/Logging/Schema.php @@ -581,7 +581,7 @@ private function columnsOf($table, $force = FALSE) { if ($force || !isset(\Civi::$statics[__CLASS__]['columnsOf'][$table])) { $from = (substr($table, 0, 4) == 'log_') ? "`{$this->db}`.$table" : $table; CRM_Core_TemporaryErrorScope::ignoreException(); - $dao = CRM_Core_DAO::executeQuery("SHOW COLUMNS FROM $from", CRM_Core_DAO::$_nullArray, TRUE, NULL, FALSE, FALSE); + $dao = CRM_Core_DAO::executeQuery("SHOW COLUMNS FROM $from", [], TRUE, NULL, FALSE, FALSE); if (is_a($dao, 'DB_Error')) { return []; } @@ -737,7 +737,7 @@ public function getLogTableSpec() { * @param string $table */ private function createLogTableFor($table) { - $dao = CRM_Core_DAO::executeQuery("SHOW CREATE TABLE $table", CRM_Core_DAO::$_nullArray, TRUE, NULL, FALSE, FALSE); + $dao = CRM_Core_DAO::executeQuery("SHOW CREATE TABLE $table", [], TRUE, NULL, FALSE, FALSE); $dao->fetch(); $query = $dao->Create_Table; @@ -785,10 +785,10 @@ private function createLogTableFor($table) { $query = self::fixTimeStampAndNotNullSQL($query); $query = preg_replace("/(,*\n*\) )ENGINE/m", "$cols\n) ENGINE", $query); - CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray, TRUE, NULL, FALSE, FALSE); + CRM_Core_DAO::executeQuery($query, [], TRUE, NULL, FALSE, FALSE); $columns = implode(', ', $this->columnsOf($table)); - CRM_Core_DAO::executeQuery("INSERT INTO `{$this->db}`.log_$table ($columns, log_conn_id, log_user_id, log_action) SELECT $columns, @uniqueID, @civicrm_user_id, 'Initialization' FROM {$table}", CRM_Core_DAO::$_nullArray, TRUE, NULL, FALSE, FALSE); + CRM_Core_DAO::executeQuery("INSERT INTO `{$this->db}`.log_$table ($columns, log_conn_id, log_user_id, log_action) SELECT $columns, @uniqueID, @civicrm_user_id, 'Initialization' FROM {$table}", [], TRUE, NULL, FALSE, FALSE); $this->tables[] = $table; if (empty($this->logs)) { diff --git a/CRM/Member/BAO/Membership.php b/CRM/Member/BAO/Membership.php index 49e5181b8be..ed44d86a56d 100644 --- a/CRM/Member/BAO/Membership.php +++ b/CRM/Member/BAO/Membership.php @@ -1249,9 +1249,7 @@ public static function getContributionPageId($membershipID) { AND mp.membership_id = " . CRM_Utils_Type::escape($membershipID, 'Integer') . " ORDER BY mp.id DESC"; - return CRM_Core_DAO::singleValueQuery($query, - CRM_Core_DAO::$_nullArray - ); + return CRM_Core_DAO::singleValueQuery($query); } /** diff --git a/CRM/Member/BAO/MembershipStatus.php b/CRM/Member/BAO/MembershipStatus.php index c3508a7e177..e6310ae68ee 100644 --- a/CRM/Member/BAO/MembershipStatus.php +++ b/CRM/Member/BAO/MembershipStatus.php @@ -137,9 +137,7 @@ public static function add(&$params, $ids = []) { // set all other defaults to false. if (!empty($params['is_default'])) { $query = "UPDATE civicrm_membership_status SET is_default = 0"; - CRM_Core_DAO::executeQuery($query, - CRM_Core_DAO::$_nullArray - ); + CRM_Core_DAO::executeQuery($query); } // action is taken depending upon the mode diff --git a/CRM/Upgrade/Form.php b/CRM/Upgrade/Form.php index 47f71da3eac..008d42210a4 100644 --- a/CRM/Upgrade/Form.php +++ b/CRM/Upgrade/Form.php @@ -272,9 +272,7 @@ public function postProcess() { * @return Object */ public function runQuery($query) { - return CRM_Core_DAO::executeQuery($query, - CRM_Core_DAO::$_nullArray - ); + return CRM_Core_DAO::executeQuery($query); } /** diff --git a/CRM/Upgrade/Incremental/php/FourFive.php b/CRM/Upgrade/Incremental/php/FourFive.php index f5b9aada415..cd9f0368a26 100644 --- a/CRM/Upgrade/Incremental/php/FourFive.php +++ b/CRM/Upgrade/Incremental/php/FourFive.php @@ -84,7 +84,7 @@ public function upgrade_4_5_alpha1($rev) { $sqlDropFK = "ALTER TABLE `civicrm_msg_template` DROP FOREIGN KEY `{$dao->CONSTRAINT_NAME}`, DROP KEY `{$dao->CONSTRAINT_NAME}`"; - CRM_Core_DAO::executeQuery($sqlDropFK, CRM_Core_DAO::$_nullArray, TRUE, NULL, FALSE, FALSE); + CRM_Core_DAO::executeQuery($sqlDropFK, [], TRUE, NULL, FALSE, FALSE); } } diff --git a/CRM/Upgrade/Incremental/php/FourThree.php b/CRM/Upgrade/Incremental/php/FourThree.php index a444e4962ba..a86316e1db8 100644 --- a/CRM/Upgrade/Incremental/php/FourThree.php +++ b/CRM/Upgrade/Incremental/php/FourThree.php @@ -834,7 +834,7 @@ public function createDomainContacts() { $query = " ALTER TABLE civicrm_domain ADD contact_id INT( 10 ) UNSIGNED NULL DEFAULT NULL COMMENT 'FK to Contact ID. This is specifically not an FK to avoid circular constraints', ADD CONSTRAINT FK_civicrm_domain_contact_id FOREIGN KEY (contact_id) REFERENCES civicrm_contact(id);"; - CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray, TRUE, NULL, FALSE, FALSE); + CRM_Core_DAO::executeQuery($query, [], TRUE, NULL, FALSE, FALSE); $query = ' SELECT cd.id, cd.name, ce.email FROM civicrm_domain cd diff --git a/sql/GenerateReportData.php b/sql/GenerateReportData.php index e50b8ddf469..dd74843a02d 100644 --- a/sql/GenerateReportData.php +++ b/sql/GenerateReportData.php @@ -1322,7 +1322,7 @@ public function addMembershipType() { ('Student', 'Discount membership for full-time students.', " . $contact_id . ", 1, 50, 'year', 1, 'rolling', null, null, 7, 'b_a', 'Public', 2, 1), ('Lifetime', 'Lifetime membership.', " . $contact_id . ", 2, 1200, 'lifetime', 1, 'rolling', null, null, 7, 'b_a', 'Admin', 3, 1); "; - CRM_Core_DAO::executeQuery($membershipType, CRM_Core_DAO::$_nullArray); + CRM_Core_DAO::executeQuery($membershipType); } public function addMembership() { @@ -1399,9 +1399,9 @@ public function addMembership() { } } - CRM_Core_DAO::executeQuery($membership, CRM_Core_DAO::$_nullArray); + CRM_Core_DAO::executeQuery($membership); - CRM_Core_DAO::executeQuery($activity, CRM_Core_DAO::$_nullArray); + CRM_Core_DAO::executeQuery($activity); } /** @@ -1445,14 +1445,14 @@ public function createEvent() { ( NULL, 1, 1, 1, 'E 11B Woodbridge Path SW', 11, 'B', NULL, 'Woodbridge', 'Path', NULL, NULL, NULL, NULL, NULL, 'Dayton', NULL, 1034, NULL, '45417', NULL, 1228, 39.7531, -84.2471, NULL), ( NULL, 1, 1, 1, 'E 581O Lincoln Dr SW', 581, 'O', NULL, 'Lincoln', 'Dr', NULL, NULL, NULL, NULL, NULL, 'Santa Fe', NULL, 1030, NULL, '87594', NULL, 1228, 35.5212, -105.982, NULL) "; - CRM_Core_DAO::executeQuery($event, CRM_Core_DAO::$_nullArray); + CRM_Core_DAO::executeQuery($event); $sql = "SELECT id from civicrm_address where street_address = 'S 14S El Camino Way E'"; - $eventAdd1 = CRM_Core_DAO::singleValueQuery($sql, CRM_Core_DAO::$_nullArray); + $eventAdd1 = CRM_Core_DAO::singleValueQuery($sql); $sql = "SELECT id from civicrm_address where street_address = 'E 11B Woodbridge Path SW'"; - $eventAdd2 = CRM_Core_DAO::singleValueQuery($sql, CRM_Core_DAO::$_nullArray); + $eventAdd2 = CRM_Core_DAO::singleValueQuery($sql); $sql = "SELECT id from civicrm_address where street_address = 'E 581O Lincoln Dr SW'"; - $eventAdd3 = CRM_Core_DAO::singleValueQuery($sql, CRM_Core_DAO::$_nullArray); + $eventAdd3 = CRM_Core_DAO::singleValueQuery($sql); $event = "INSERT INTO civicrm_email (contact_id, location_type_id, email, is_primary, is_billing, on_hold, hold_date, reset_date) VALUES @@ -1460,14 +1460,14 @@ public function createEvent() { (NULL, 1, 'tournaments@example.org', 0, 0, 0, NULL, NULL), (NULL, 1, 'celebration@example.org', 0, 0, 0, NULL, NULL) "; - CRM_Core_DAO::executeQuery($event, CRM_Core_DAO::$_nullArray); + CRM_Core_DAO::executeQuery($event); $sql = "SELECT id from civicrm_email where email = 'development@example.org'"; - $eventEmail1 = CRM_Core_DAO::singleValueQuery($sql, CRM_Core_DAO::$_nullArray); + $eventEmail1 = CRM_Core_DAO::singleValueQuery($sql); $sql = "SELECT id from civicrm_email where email = 'tournaments@example.org'"; - $eventEmail2 = CRM_Core_DAO::singleValueQuery($sql, CRM_Core_DAO::$_nullArray); + $eventEmail2 = CRM_Core_DAO::singleValueQuery($sql); $sql = "SELECT id from civicrm_email where email = 'celebration@example.org'"; - $eventEmail3 = CRM_Core_DAO::singleValueQuery($sql, CRM_Core_DAO::$_nullArray); + $eventEmail3 = CRM_Core_DAO::singleValueQuery($sql); $event = "INSERT INTO civicrm_phone (contact_id, location_type_id, is_primary, is_billing, mobile_provider_id, phone, phone_type_id) VALUES @@ -1475,14 +1475,14 @@ public function createEvent() { (NULL, 1, 0, 0, NULL,'204 223-1000', '1'), (NULL, 1, 0, 0, NULL,'303 323-1000', '1') "; - CRM_Core_DAO::executeQuery($event, CRM_Core_DAO::$_nullArray); + CRM_Core_DAO::executeQuery($event); $sql = "SELECT id from civicrm_phone where phone = '204 222-1000'"; - $eventPhone1 = CRM_Core_DAO::singleValueQuery($sql, CRM_Core_DAO::$_nullArray); + $eventPhone1 = CRM_Core_DAO::singleValueQuery($sql); $sql = "SELECT id from civicrm_phone where phone = '204 223-1000'"; - $eventPhone2 = CRM_Core_DAO::singleValueQuery($sql, CRM_Core_DAO::$_nullArray); + $eventPhone2 = CRM_Core_DAO::singleValueQuery($sql); $sql = "SELECT id from civicrm_phone where phone = '303 323-1000'"; - $eventPhone3 = CRM_Core_DAO::singleValueQuery($sql, CRM_Core_DAO::$_nullArray); + $eventPhone3 = CRM_Core_DAO::singleValueQuery($sql); $event = "INSERT INTO civicrm_loc_block ( address_id, email_id, phone_id, address_2_id, email_2_id, phone_2_id) VALUES @@ -1491,14 +1491,14 @@ public function createEvent() { ( $eventAdd3, $eventEmail3, $eventPhone3, NULL,NULL,NULL) "; - CRM_Core_DAO::executeQuery($event, CRM_Core_DAO::$_nullArray); + CRM_Core_DAO::executeQuery($event); $sql = "SELECT id from civicrm_loc_block where phone_id = $eventPhone1 AND email_id = $eventEmail1 AND address_id = $eventAdd1"; - $eventLok1 = CRM_Core_DAO::singleValueQuery($sql, CRM_Core_DAO::$_nullArray); + $eventLok1 = CRM_Core_DAO::singleValueQuery($sql); $sql = "SELECT id from civicrm_loc_block where phone_id = $eventPhone2 AND email_id = $eventEmail2 AND address_id = $eventAdd2"; - $eventLok2 = CRM_Core_DAO::singleValueQuery($sql, CRM_Core_DAO::$_nullArray); + $eventLok2 = CRM_Core_DAO::singleValueQuery($sql); $sql = "SELECT id from civicrm_loc_block where phone_id = $eventPhone3 AND email_id = $eventEmail3 AND address_id = $eventAdd3"; - $eventLok3 = CRM_Core_DAO::singleValueQuery($sql, CRM_Core_DAO::$_nullArray); + $eventLok3 = CRM_Core_DAO::singleValueQuery($sql); //create event fees $optionGroup = "INSERT INTO civicrm_option_group ( name, is_reserved, is_active) @@ -1507,16 +1507,16 @@ public function createEvent() { ( 'civicrm_event.amount.2', 0, 1), ( 'civicrm_event.amount.3', 0, 1) "; - CRM_Core_DAO::executeQuery($optionGroup, CRM_Core_DAO::$_nullArray); + CRM_Core_DAO::executeQuery($optionGroup); $sql = "SELECT max(id) from civicrm_option_group where name = 'civicrm_event.amount.1'"; - $page1 = CRM_Core_DAO::singleValueQuery($sql, CRM_Core_DAO::$_nullArray); + $page1 = CRM_Core_DAO::singleValueQuery($sql); $sql = "SELECT max(id) from civicrm_option_group where name = 'civicrm_event.amount.2'"; - $page2 = CRM_Core_DAO::singleValueQuery($sql, CRM_Core_DAO::$_nullArray); + $page2 = CRM_Core_DAO::singleValueQuery($sql); $sql = "SELECT max(id) from civicrm_option_group where name = 'civicrm_event.amount.3'"; - $page3 = CRM_Core_DAO::singleValueQuery($sql, CRM_Core_DAO::$_nullArray); + $page3 = CRM_Core_DAO::singleValueQuery($sql); $optionValue = "INSERT INTO civicrm_option_value (option_group_id, label, value, is_default, weight, is_optgroup, is_reserved, is_active) VALUES @@ -1530,16 +1530,16 @@ public function createEvent() { ($page3, 'Junior Stars (ages 9-12)', '1000', 0, 2, 0, 0, 1), ($page3, 'Super Stars (ages 13-18)', '1500', 0, 3, 0, 0, 1)"; - CRM_Core_DAO::executeQuery($optionValue, CRM_Core_DAO::$_nullArray); + CRM_Core_DAO::executeQuery($optionValue); $sql = "SELECT max(id) FROM civicrm_option_value WHERE civicrm_option_value.option_group_id = $page1 AND civicrm_option_value.weight=2"; - $defaultFee1 = CRM_Core_DAO::singleValueQuery($sql, CRM_Core_DAO::$_nullArray); + $defaultFee1 = CRM_Core_DAO::singleValueQuery($sql); $sql = "SELECT max(id) FROM civicrm_option_value WHERE civicrm_option_value.option_group_id = $page2 AND civicrm_option_value.weight=2"; - $defaultFee2 = CRM_Core_DAO::singleValueQuery($sql, CRM_Core_DAO::$_nullArray); + $defaultFee2 = CRM_Core_DAO::singleValueQuery($sql); $sql = "SELECT max(id) FROM civicrm_option_value WHERE civicrm_option_value.option_group_id = $page3 AND civicrm_option_value.weight=2"; - $defaultFee3 = CRM_Core_DAO::singleValueQuery($sql, CRM_Core_DAO::$_nullArray); + $defaultFee3 = CRM_Core_DAO::singleValueQuery($sql); $event = "INSERT INTO civicrm_event ( title, summary, description, event_type_id, participant_listing_id, is_public, start_date, end_date, is_online_registration, registration_link_text, max_participants, event_full_text, is_monetary, financial_type_id, is_map, is_active, fee_label, is_show_location, loc_block_id,intro_text, footer_text, confirm_title, confirm_text, confirm_footer_text, is_email_confirm, confirm_email_text, confirm_from_name, confirm_from_email, cc_confirm, bcc_confirm, default_fee_id, thankyou_title, thankyou_text, thankyou_footer_text, is_pay_later, pay_later_text, pay_later_receipt, is_multiple_registrations, allow_same_participant_emails ) @@ -1548,7 +1548,7 @@ public function createEvent() { ( 'Summer Solstice Festival Day Concert', 'Festival Day is coming! Join us and help support your parks.', 'We will gather at noon, learn a song all together, and then join in a joyous procession to the pavilion. We will be one of many groups performing at this wonderful concert which benefits our city parks.', 5, 1, 1, '2011-06-01 12:00:00', '2011-06-01 17:00:00', 1, 'Register Now', 50, 'We have all the singers we can handle. Come to the pavilion anyway and join in from the audience.', 1, 2, NULL, 1, 'Festival Fee', 1, $eventLok2, 'Complete the form below and click Continue to register online for the festival. Or you can register by calling us at 204 222-1000 ext 22.', '', 'Confirm Your Registration Information', '', '', 1, 'This email confirms your registration. If you have questions or need to change your registration - please do not hesitate to call us.', 'Event Dept.', 'events@example.org', '', NULL, {$defaultFee2}, 'Thanks for Your Joining In!', '

Thank you for your support. Your participation will help build new parks.

Please tell your friends and colleagues about the concert.

', '

Back to CiviCRM Home Page

', 0, NULL, NULL, 1, 0 ), ( 'Rain-forest Cup Youth Soccer Tournament', 'Sign up your team to participate in this fun tournament which benefits several Rain-forest protection groups in the Amazon basin.', 'This is a FYSA Sanctioned Tournament, which is open to all USSF/FIFA affiliated organizations for boys and girls in age groups: U9-U10 (6v6), U11-U12 (8v8), and U13-U17 (Full Sided).', 3, 1, 1, '2011-12-27 07:00:00', '2011-12-29 17:00:00', 1, 'Register Now', 500, 'Sorry! All available team slots for this tournament have been filled. Contact Jill Futbol for information about the waiting list and next years event.', 1, 4, NULL, 1, 'Tournament Fees',1, $eventLok3, 'Complete the form below to register your team for this year''s tournament.', 'A Soccer Youth Event', 'Review and Confirm Your Registration Information', '', 'A Soccer Youth Event', 1, 'Contact our Tournament Director for eligibility details.', 'Tournament Director', 'tournament@example.org', '', NULL, {$defaultFee3}, 'Thanks for Your Support!', '

Thank you for your support. Your participation will help save thousands of acres of rainforest.

', '

Back to CiviCRM Home Page

', 0, NULL, NULL, 0, 0 ) "; - CRM_Core_DAO::executeQuery($event, CRM_Core_DAO::$_nullArray); + CRM_Core_DAO::executeQuery($event); } public function addParticipant() { @@ -1619,7 +1619,7 @@ public function addSoftContribution() { $sql = "SELECT DISTINCT(contact_id), id, total_amount from civicrm_contribution LIMIT 200"; - $contriInfo = CRM_Core_DAO::executeQuery($sql, CRM_Core_DAO::$_nullArray); + $contriInfo = CRM_Core_DAO::executeQuery($sql); $prevContactID = NULL; @@ -1646,7 +1646,7 @@ public function addPledge() { (43, 1, 1, 800.00, 'month', 3, 1, 4, '2010-07-01 10:11:09', '2010-06-23 10:11:14', '2010-06-23 10:11:18', NULL, NULL, '2010-04-01 10:11:40', NULL, NULL, 5, 0), (32, 1, 1, 600.00, 'month', 1, 1, 3, '2010-06-01 10:12:35', '2010-05-14 10:12:44', '2010-05-14 10:12:52', NULL, NULL, '2010-08-01 10:13:11', NULL, NULL, 5, 0); "; - CRM_Core_DAO::executeQuery($pledge, CRM_Core_DAO::$_nullArray); + CRM_Core_DAO::executeQuery($pledge); } public function addPledgePayment() { @@ -1662,7 +1662,7 @@ public function addPledgePayment() { (3, 13, 200.00, '2010-07-01 10:59:35', '2010-06-28 10:59:41', 1, 1), (3, null, 200.00, '2010-08-01 11:00:12', null, 0, 2); "; - CRM_Core_DAO::executeQuery($pledgePayment, CRM_Core_DAO::$_nullArray); + CRM_Core_DAO::executeQuery($pledgePayment); } public function addMembershipPayment() { @@ -1687,7 +1687,7 @@ public function addMembershipPayment() { WHERE contribution_page_id IS NULL AND total_amount = {$amount[$i]} limit 0, 50 "; - $contributionDAO = CRM_Core_DAO::executeQuery($contributionSQL, CRM_Core_DAO::$_nullArray); + $contributionDAO = CRM_Core_DAO::executeQuery($contributionSQL); while ($contributionDAO->fetch()) { $contributionsArray[] = $contributionDAO->id; @@ -1697,7 +1697,7 @@ public function addMembershipPayment() { SELECT id FROM civicrm_membership WHERE civicrm_membership.membership_type_id = {$j} limit 0, 50"; - $membershipDAO = CRM_Core_DAO::executeQuery($membershipSQL, CRM_Core_DAO::$_nullArray); + $membershipDAO = CRM_Core_DAO::executeQuery($membershipSQL); while ($membershipDAO->fetch()) { $membershipArray[] = $membershipDAO->id;