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

Core/Base/Exceptions/BadStateException.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\Base\Exceptions;
8
9 use eZ\Publish\API\Repository\Exceptions\BadStateException as APIBadStateException;
10 use Exception;
11 use eZ\Publish\Core\Base\Translatable;
12 use eZ\Publish\Core\Base\TranslatableBase;
13
19 class BadStateException extends APIBadStateException implements Translatable
20 {
21 use TranslatableBase;
22
30 public function __construct($argumentName, $whatIsWrong, Exception $previous = null)
31 {
32 $this->setMessageTemplate("Argument '%argumentName%' has a bad state: %whatIsWrong%");
33 $this->setParameters(['%argumentName%' => $argumentName, '%whatIsWrong%' => $whatIsWrong]);
34 parent::__construct($this->getBaseTranslation(), 0, $previous);
35 }
36 }
eZ\Publish\Core\Base\TranslatableBase
trait TranslatableBase
Trait providing a default implementation of Translatable.
Definition: TranslatableBase.php:13
eZ\Publish\API\Repository\Exceptions\BadStateException
This Exception is thrown if a method is called with an value referencing an object which is not in th...
Definition: API/Repository/Exceptions/BadStateException.php:13
eZ\Publish\Core\Base\Exceptions\BadStateException
BadState Exception implementation.
Definition: Core/Base/Exceptions/BadStateException.php:20
eZ\Publish\Core\Base\Exceptions\BadStateException\__construct
__construct($argumentName, $whatIsWrong, Exception $previous=null)
Generates: "Argument '{$argumentName}' has a bad state: {$whatIsWrong}".
Definition: Core/Base/Exceptions/BadStateException.php:30
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\Exceptions
Definition: Core/Base/Exceptions/BadStateException.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.