public function DisplayPluginBase::acceptAttachments

Determines whether this display can use attachments.

Return value

bool

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php, line 345
Contains Drupal\views\Plugin\views\display\DisplayPluginBase.

Class

DisplayPluginBase
The default display plugin handler. Display plugins handle options and basic mechanisms for different output methods.

Namespace

Drupal\views\Plugin\views\display

Code

public function acceptAttachments() {

  // To be able to accept attachments this display have to be able to use
  // attachments but at the same time, you cannot attach a display to itself.
  if (!$this
    ->usesAttachments() || $this->definition['id'] == $this->view->current_display) {
    return FALSE;
  }
  if (!empty($this->view->argument) && $this
    ->getOption('hide_attachment_summary')) {
    foreach ($this->view->argument as $argument_id => $argument) {
      if ($argument
        ->needsStylePlugin() && empty($argument->argument_validated)) {
        return FALSE;
      }
    }
  }
  return TRUE;
}