You are here

protected function ViewsFieldTemplate::alterViewTemplateAfterCreation in Calendar 8

After View Template has been created the Builder should alter it some how.

Parameters

array $view_template: The array of view template.

array $options: Options for altering.

Overrides ViewsDuplicateBuilderBase::alterViewTemplateAfterCreation

File

src/Plugin/ViewsTemplateBuilder/ViewsFieldTemplate.php, line 65

Class

ViewsFieldTemplate
Views Template for all calendar fields.

Namespace

Drupal\calendar\Plugin\ViewsTemplateBuilder

Code

protected function alterViewTemplateAfterCreation(array &$view_template, array $options = NULL) {
  parent::alterViewTemplateAfterCreation($view_template, $options);
  $field_defs = $this->fieldManager
    ->getBaseFieldDefinitions($this
    ->getDefinitionValue('entity_type'));
  if (empty($field_defs['status'])) {

    // If entity doesn't have a base field status remove it from View filter.
    unset($view_template['display']['default']['display_options']['filters']['status']);
  }
  $this->fieldManager
    ->getFieldDefinitions($this
    ->getDefinitionValue('entity_type'), 'event');
  $this->fieldManager
    ->getFieldStorageDefinitions('node');
}