require_once 'CRM/Core/PseudoConstant.php'; // Get the array of greeting options $greetingOptions = CRM_Core_PseudoConstant::getGreeting(); // Display the drop-down list in HTML echo '';
require_once 'CRM/Core/PseudoConstant.php'; // Set the greeting option of contact ID 123 to 'Dear Mr.' CRM_Core_PseudoConstant::setValue('Contact', 'addressee_display', 'Dear Mr.', 123);This example shows how to use the CRM_Core_PseudoConstant::setValue() function to set the greeting option for a specific contact record. This is useful when updating a contact record through a custom PHP script or during a CiviCRM event-triggered script. Overall, the CRM_Core_PseudoConstant greeting is a useful tool for developers who are building applications that need to interact with CiviCRM's contact database, and the functionality it provides is part of the CiviCRM package library.