protected function Entity::defineOptions

Information about options for all kinds of purposes will be held here. @code 'option_name' => array(

  • 'default' => default value,
  • 'translatable' => (optional) TRUE/FALSE (wrap in t() on export if true),
  • '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().
  • 'bool' => (optional) TRUE/FALSE Is the value a boolean value. This will change the export format to TRUE/FALSE instead of 1/0.

),

Return value

array Returns the options of this handler/plugin.

Overrides TokenizeAreaPluginBase::defineOptions

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/area/Entity.php, line 41
Contains \Drupal\views\Plugin\views\area\Entity.

Class

Entity
Provides an area handler which renders an entity in a certain view mode.

Namespace

Drupal\views\Plugin\views\area

Code

protected function defineOptions() {
  $options = parent::defineOptions();

  // Per default we enable tokenize, as this is the most common use case for
  // this handler.
  $options['tokenize']['default'] = TRUE;
  $options['entity_id'] = array(
    'default' => '',
  );
  $options['view_mode'] = array(
    'default' => '',
  );
  return $options;
}