You are here

public function CiviCrmApi::getOptions in CiviCRM Entity 8.3

Get options for the CiviCRM entity field.

Parameters

string $entity: The entity name.

string $field_name: The field name.

Return value

array The array of options.

Overrides CiviCrmApiInterface::getOptions

File

src/CiviCrmApi.php, line 79

Class

CiviCrmApi
CiviCRM API implementation.

Namespace

Drupal\civicrm_entity

Code

public function getOptions($entity, $field_name) {
  $this
    ->initialize();
  $result = civicrm_api3($entity, 'getoptions', [
    'field' => $field_name,
  ]);
  return $result['values'];
}