Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

MVC/Symfony/View/Provider/Registry.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\MVC\Symfony\View\Provider;
8
9 use eZ\Publish\Core\Base\Exceptions\InvalidArgumentException;
10 use eZ\Publish\Core\MVC\Symfony\View\View;
11
12 class Registry
13 {
19 private $viewProviders;
20
28 public function getViewProviders(View $view)
29 {
30 foreach (array_keys($this->viewProviders) as $type) {
31 if ($view instanceof $type) {
32 return $this->viewProviders[$type];
33 }
34 }
35 throw new InvalidArgumentException('view', 'No compatible ViewProvider found for ' . gettype($view));
36 }
37
43 public function setViewProviders(array $viewProviders)
44 {
45 $this->viewProviders = $viewProviders;
46 }
47 }
eZ\Publish\Core\Base\Exceptions\InvalidArgumentException
Invalid Argument Type Exception implementation.
Definition: Core/Base/Exceptions/InvalidArgumentException.php:20
eZ\Publish\Core\MVC\Symfony\View\Provider\Registry
Definition: MVC/Symfony/View/Provider/Registry.php:13
eZ\Publish\Core\MVC\Symfony\View\Provider\Registry\getViewProviders
getViewProviders(View $view)
Definition: MVC/Symfony/View/Provider/Registry.php:28
eZ\Publish\Core\MVC\Symfony\View\Provider\Registry\setViewProviders
setViewProviders(array $viewProviders)
Sets the complete list of view providers.
Definition: MVC/Symfony/View/Provider/Registry.php:43
eZ\Publish\Core\MVC\Symfony\View\Provider\Registry\$viewProviders
$viewProviders
Definition: MVC/Symfony/View/Provider/Registry.php:19
eZ\Publish\Core\MVC\Symfony\View\View
Main interface for Views of Value objects (content, block...).
Definition: Publish/Core/MVC/Symfony/View/View.php:16
eZ\Publish\Core\MVC\Symfony\View\Provider
Definition: MVC/Symfony/View/Provider/Block.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.