You are here

protected function CustomEntityField::defineOptions in CiviCRM Entity 8.3

Information about options for all kinds of purposes will be held here.


'option_name' => array(
 - 'default' => default value,
 - 'contains' => (optional) array of items this contains, with its own
     defaults, etc. If contains is set, the default will be ignored and
     assumed to be array().
 ),

Return value

array Returns the options of this handler/plugin.

Overrides EntityField::defineOptions

File

src/Plugin/views/field/CustomEntityField.php, line 102

Class

CustomEntityField
A field that displays entity field data for custom fields.

Namespace

Drupal\civicrm_entity\Plugin\views\field

Code

protected function defineOptions() {
  $options = parent::defineOptions();
  unset($options['click_sort_column']);
  if (in_array($this->fieldMetadata['html_type'], [
    'Multi-Select',
    'CheckBox',
  ])) {
    $options['type']['default'] = 'civicrm_entity_custom_multi_value';
  }
  return $options;
}