Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ViewExecutable.php

function ViewExecutable::validate

Makes sure the view is completely valid.

Return value

array An array of error strings. This will be empty if there are no validation errors.

File

core/modules/views/src/ViewExecutable.php, line 2149

Class

ViewExecutable
Represents a view as a whole.

Namespace

Drupal\views

Code

public function validate() {
    $errors = [];
    $this->initDisplay();
    $current_display = $this->current_display;
    foreach ($this->displayHandlers as $id => $display) {
        if (!empty($display)) {
            if (!empty($display->display['deleted'])) {
                continue;
            }
            $result = $this->displayHandlers
                ->get($id)
                ->validate();
            if (!empty($result) && is_array($result)) {
                $errors[$id] = $result;
            }
        }
    }
    $this->setDisplay($current_display);
    return $errors;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal