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

MissingClass.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\Base\Exceptions;
8
9 use Exception;
10 use eZ\Publish\Core\Base\Translatable;
11 use eZ\Publish\Core\Base\TranslatableBase;
12 use LogicException;
13
22 class MissingClass extends LogicException implements Translatable
23 {
24 use TranslatableBase;
25
33 public function __construct($className, $classType = null, Exception $previous = null)
34 {
35 $this->setParameters(['%className%' => $className]);
36 if ($classType === null) {
37 $this->setMessageTemplate("Could not find class '%className%'");
38 } else {
39 $this->setMessageTemplate("Could not find %classType% class '%className%'");
40 $this->addParameter('%classType%', $classType);
41 }
42
43 parent::__construct($this->getBaseTranslation(), 0, $previous);
44 }
45 }
eZ\Publish\Core\Base\TranslatableBase
trait TranslatableBase
Trait providing a default implementation of Translatable.
Definition: TranslatableBase.php:13
eZ\Publish\Core\Base\Exceptions\MissingClass
MissingClass Exception implementation.
Definition: MissingClass.php:23
eZ\Publish\Core\Base\Exceptions\MissingClass\__construct
__construct($className, $classType=null, Exception $previous=null)
Generates: Could not find[ {$classType}] class '{$className}'.
Definition: MissingClass.php:33
eZ\Publish\Core\Base\Translatable
Interface for translatable value objects.
Definition: Core/Base/Translatable.php:13
eZ\Publish\Core\Base\Translatable\setMessageTemplate
setMessageTemplate($messageTemplate)
Injects the message template.
eZ\Publish\Core\Base\Translatable\getBaseTranslation
getBaseTranslation()
Returns base translation, computed with message template and parameters.
eZ\Publish\Core\Base\Translatable\setParameters
setParameters(array $parameters)
Injects the hash map, with param placeholder as key and its corresponding value.
eZ\Publish\Core\Base\Translatable\addParameter
addParameter($name, $value)
Adds a parameter to existing hash map.
eZ\Publish\Core\Base\Exceptions
Definition: Core/Base/Exceptions/BadStateException.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.