_contactIds); $query = " SELECT c.id as contact_id, c.display_name as name, c.contact_type as contact_type, e.email as email FROM civicrm_contact c, civicrm_email e WHERE e.contact_id = c.id AND e.is_primary = 1 AND c.id IN ( $contactIDs )"; $rows = []; $dao = CRM_Core_DAO::executeQuery($query); while ($dao->fetch()) { $rows[] = [ 'id' => $dao->contact_id, 'name' => $dao->name, 'contact_type' => $dao->contact_type, 'email' => $dao->email, ]; } $this->assign('rows', $rows); } /** * Build the form object. */ public function buildQuickForm() { $this->addDefaultButtons(ts('Back to Search'), 'done'); } /** * Process the form after the input has been submitted and validated. */ public function postProcess() { } }