$contact = new CRM_Contact_BAO_Contact(); $contact->first_name = 'John'; $contact->last_name = 'Doe'; $contact->email = 'john.doe@example.com'; $contact->save();
$params = [ 'query' => 'john.doe@example.com', 'contact_type' => 'Individual', 'return' => ['id', 'first_name', 'last_name', 'email'] ]; $results = CRM_Contact_BAO_Contact::search($params);This code searches for all individual contacts with the email 'john.doe@example.com' and returns their ID, first name, last name and email. Overall, the CRM_Contact_BAO_Contact class is part of the CiviCRM library which is a package/library that provides a suite of tools for managing and interacting with contact information in a CRM system.