CRM-20786 minor code simplification
authoreileen <emcnaughton@wikimedia.org>
Wed, 28 Jun 2017 21:08:04 +0000 (09:08 +1200)
committereileen <emcnaughton@wikimedia.org>
Wed, 28 Jun 2017 21:08:04 +0000 (09:08 +1200)
CRM/Event/Import/Parser/Participant.php

index d19eadd171030da3e87a361a9e6d1f420ac0c068..39c2b4c85571b2a5ce187035075e77f08cd97e31 100644 (file)
@@ -574,12 +574,7 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser {
           if (!CRM_Utils_Rule::integer($value)) {
             return civicrm_api3_create_error("contact_id not valid: $value");
           }
-          $dao = new CRM_Core_DAO();
-          $qParams = array();
-          $svq = $dao->singleValueQuery("SELECT id FROM civicrm_contact WHERE id = $value",
-            $qParams
-          );
-          if (!$svq) {
+          if (!CRM_Core_DAO::singleValueQuery("SELECT id FROM civicrm_contact WHERE id = $value")) {
             return civicrm_api3_create_error("Invalid Contact ID: There is no contact record with contact_id = $value.");
           }
           $values['contact_id'] = $values['participant_contact_id'];