You are here

public function CustomEntityField::init in CiviCRM Entity 8.3

Initialize the plugin.

Parameters

\Drupal\views\ViewExecutable $view: The view object.

\Drupal\views\Plugin\views\display\DisplayPluginBase $display: The display handler.

array $options: The options configured for this plugin.

Overrides EntityField::init

File

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

Class

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

Namespace

Drupal\civicrm_entity\Plugin\views\field

Code

public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
  $field_definition = $this
    ->getFieldDefinition();
  if ($settings = $field_definition
    ->getSetting('civicrm_entity_field_metadata')) {
    $this->fieldMetadata = $settings;
    if ($this->fieldMetadata['is_multiple']) {
      $this->fieldDefinition
        ->setCardinality($this->fieldMetadata['max_multiple']);
    }
  }
  parent::init($view, $display, $options);
}