Description: The CRM_Contact_BAO_Contact getContactDetails method retrieves the details of a contact from the CRM database. This method takes the contact ID as an argument and returns an array containing the contact details such as name, email, phone number, address, etc.
Example:
To use the getContactDetails method, you can start by including the CRM_Utils_API.php file:
require_once 'CRM/Core/BAO/Contact.php';
Now, you can use the method to retrieve the details of a contact:
$contact_id = 123; // replace with contact id you want to retrieve details of
// print_r the contact details array to view its contents: print_r($contact_details);
Output:
Array ( [id] => 123 [contact_type] => Individual [organization_name] => [legal_name] => [display_name] => John Doe [first_name] => John [last_name] => Doe [email] => john.doe@example.com [phone] => 555-555-1212 [address] => 123 Main St. [city] => Anytown [state_province_id] => 123 [postal_code_suffix] => [country_id] => 123 )
This example retrieves the details of a contact with the ID 123 and prints the results using the print_r function.
Package Library: The CRM_Contact_BAO_Contact class is part of the CiviCRM package library.
PHP CRM_Contact_BAO_Contact::getContactDetails - 30 examples found. These are the top rated real world PHP examples of CRM_Contact_BAO_Contact::getContactDetails extracted from open source projects. You can rate examples to help us improve the quality of examples.