You are here

function redhen_contact_type_options_list in RedHen CRM 8

Same name and namespace in other branches
  1. 7 modules/redhen_contact/redhen_contact.module \redhen_contact_type_options_list()

Return an associative array of contact types to be used as an options list.

Return value

array Keyed by name with a label value.

2 calls to redhen_contact_type_options_list()
ContactSettingsForm::buildForm in modules/redhen_contact/src/Form/ContactSettingsForm.php
Defines the settings form for Contact entities.
redhen_contact_form_user_register_form_alter in modules/redhen_contact/redhen_contact.module
Implements hook_form_FORM_ID_alter() on the user_register_form.

File

modules/redhen_contact/redhen_contact.module, line 179
Contains redhen_contact.module..

Code

function redhen_contact_type_options_list() {
  $options = [];
  foreach (ContactType::loadMultiple() as $type) {
    $options[$type
      ->id()] = $type
      ->label();
  }
  return $options;
}