You are here

function hook_redhen_contact_name_alter in RedHen CRM 8

Same name and namespace in other branches
  1. 7 redhen.api.php \hook_redhen_contact_name_alter()

Alter the display name for a contact.

Parameters

string $name: The generated name.

Drupal\redhen_contact\ContactInterface $contact: The contact whose name is being generated.

Return value

string

1 invocation of hook_redhen_contact_name_alter()
Contact::getFullName in modules/redhen_contact/src/Entity/Contact.php
Gets the full Contact name.

File

modules/redhen_contact/redhen_contact.api.php, line 23
Describes API functions for the RedHen Contact module.

Code

function hook_redhen_contact_name_alter(&$name, Drupal\redhen_contact\ContactInterface $contact) {
  return $contact
    ->get('last_name')->value . ', ' . $contact
    ->get('first_name')->value;
}