You are here

public function ConnectionRelationship::buildOptionsForm in RedHen CRM 8

Provide a form to edit options for this plugin.

Overrides RelationshipPluginBase::buildOptionsForm

File

modules/redhen_connection/src/Plugin/views/relationship/ConnectionRelationship.php, line 62

Class

ConnectionRelationship
Views relationship plugin for datasources.

Namespace

Drupal\redhen_connection\Plugin\views\relationship

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  parent::buildOptionsForm($form, $form_state);
  $form['required']['#access'] = FALSE;
  $form['status'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Connection Status'),
    '#description' => $this
      ->t('Filter based on status of the Connection Entity.'),
    '#options' => [
      '_any' => $this
        ->t('Any'),
      '0' => $this
        ->t('Inactive'),
      '1' => $this
        ->t('Active'),
    ],
    '#default_value' => $this->options['status'],
    '#weight' => -1,
  ];
  $form['status__endpoint_1'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Connection Endpoint 1 Status'),
    '#description' => $this
      ->t('Filter based on status of the Connection Endpoint 1 Entity.'),
    '#options' => [
      '_any' => $this
        ->t('Any'),
      '0' => $this
        ->t('Inactive'),
      '1' => $this
        ->t('Active'),
    ],
    '#default_value' => $this->options['status__endpoint_1'],
    '#weight' => -1,
  ];
  $form['status__endpoint_2'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Connection Endpoint 2 Status'),
    '#description' => $this
      ->t('Filter based on status of the Connection Endpoint 2 Entity.'),
    '#options' => [
      '_any' => $this
        ->t('Any'),
      '0' => $this
        ->t('Inactive'),
      '1' => $this
        ->t('Active'),
    ],
    '#default_value' => $this->options['status__endpoint_2'],
    '#weight' => -1,
  ];
}