You are here

public function NumericRawSQLField::buildOptionsForm in Views Raw SQL 8

Default options form that provides the label widget that all fields should have.

Overrides NumericField::buildOptionsForm

File

src/Plugin/views/field/NumericRawSQLField.php, line 73

Class

NumericRawSQLField
Field handler to flag the node type.

Namespace

Drupal\views_raw_sql\Plugin\views\field

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  parent::buildOptionsForm($form, $form_state);
  if ($this->account
    ->hasPermission('edit views raw sql')) {
    $form['raw_sql'] = [
      '#type' => 'textfield',
      '#title' => t('Raw SQL'),
      '#default_value' => $this->options['raw_sql'],
      '#weight' => -6,
    ];
  }
}