You are here

public static function OrganizationType::getNames in CRM Core 8

Same name and namespace in other branches
  1. 8.3 modules/crm_core_contact/src/Entity/OrganizationType.php \Drupal\crm_core_contact\Entity\OrganizationType::getNames()
  2. 8.2 modules/crm_core_contact/src/Entity/OrganizationType.php \Drupal\crm_core_contact\Entity\OrganizationType::getNames()

Returns the human readable name of any or all contact types.

Return value

array An array containing all human readable names keyed on the machine type.

Overrides ContactTypeInterface::getNames

1 call to OrganizationType::getNames()
OrganizationCRUDTest::testOrganizationType in modules/crm_core_contact/tests/src/Kernel/OrganizationCRUDTest.php
Tests CRUD of organization types.

File

modules/crm_core_contact/src/Entity/OrganizationType.php, line 121

Class

OrganizationType
CRM Organization Type Entity Class.

Namespace

Drupal\crm_core_contact\Entity

Code

public static function getNames() {
  $organization_types = OrganizationType::loadMultiple();
  $organization_types = array_map(function ($organization_type) {
    return $organization_type
      ->label();
  }, $organization_types);
  return $organization_types;
}