function Views::getView
Loads a view from configuration and returns its executable object.
Parameters
string $id: The view ID to load.
Return value
\Drupal\views\ViewExecutable|null A view executable instance or NULL if the view does not exist.
7 calls to Views::getView()
- GroupwiseMax::leftQuery in core/
modules/ views/ src/ Plugin/ views/ relationship/ GroupwiseMax.php - Generate a subquery given the user options, as set in the options.
- View::preRenderViewElement in core/
modules/ views/ src/ Element/ View.php - View element pre render callback.
- ViewEditForm::save in core/
modules/ views_ui/ src/ ViewEditForm.php - Form submission handler for the 'save' action.
- ViewPageController::getTitle in core/
modules/ views/ src/ Routing/ ViewPageController.php - Gets the title of the given view's display.
- ViewsSelection::initializeView in core/
modules/ views/ src/ Plugin/ EntityReferenceSelection/ ViewsSelection.php - Initializes a view.
File
-
core/
modules/ views/ src/ Views.php, line 121
Class
- Views
- Static service container wrapper for views.
Namespace
Drupal\viewsCode
public static function getView($id) {
$view = \Drupal::entityTypeManager()->getStorage('view')
->load($id);
if ($view) {
return static::executableFactory()->get($view);
}
return NULL;
}