function DisplayPluginBase::isIdentifierUnique

Same name in other branches
  1. 8.9.x core/modules/views/src/Plugin/views/display/DisplayPluginBase.php \Drupal\views\Plugin\views\display\DisplayPluginBase::isIdentifierUnique()
  2. 10 core/modules/views/src/Plugin/views/display/DisplayPluginBase.php \Drupal\views\Plugin\views\display\DisplayPluginBase::isIdentifierUnique()
  3. 11.x core/modules/views/src/Plugin/views/display/DisplayPluginBase.php \Drupal\views\Plugin\views\display\DisplayPluginBase::isIdentifierUnique()

Overrides DisplayPluginInterface::isIdentifierUnique

File

core/modules/views/src/Plugin/views/display/DisplayPluginBase.php, line 2564

Class

DisplayPluginBase
Base class for views display plugins.

Namespace

Drupal\views\Plugin\views\display

Code

public function isIdentifierUnique($id, $identifier) {
    foreach (ViewExecutable::getHandlerTypes() as $type => $info) {
        foreach ($this->getHandlers($type) as $key => $handler) {
            if ($handler->canExpose() && $handler->isExposed()) {
                if ($handler->isAGroup()) {
                    if ($id != $key && $identifier == $handler->options['group_info']['identifier']) {
                        return FALSE;
                    }
                }
                else {
                    if ($id != $key && isset($handler->options['expose']['identifier']) && $identifier == $handler->options['expose']['identifier']) {
                        return FALSE;
                    }
                }
            }
        }
    }
    return TRUE;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.