ILIAS
release_9 Revision v9.13-25-g2c18ec4c24f
◀ ilDoc Overview
ConstraintViolationException.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\Refinery
;
22
23
use
UnexpectedValueException
;
24
25
/***
26
* Signals the violation of some constraint on a value in a way that can be subject
27
* to i18n.
28
*/
29
class
ConstraintViolationException
extends
UnexpectedValueException
30
{
31
private
string
$languageId
;
32
private
array
$languageValues
;
33
41
public
function
__construct
(
42
string
$message
,
43
string
$languageId,
44
...$languageValues
45
) {
46
parent::__construct
($message);
47
48
$this->
languageId
=
$languageId
;
49
$this->languageValues =
$languageValues
;
50
}
51
52
public
function
getTranslatedMessage
(callable
$txt
): string
53
{
54
return
vsprintf(
$txt
($this->
languageId
), $this->languageValues);
55
}
56
}
ILIAS\Refinery
Definition:
ByTrying.php:21
ILIAS\Refinery\ConstraintViolationException\$languageId
string $languageId
Definition:
ConstraintViolationException.php:31
languageId
Definition:
ThreadSortation.php:32
UnexpectedValueException
ILIAS\MetaData\Repository\Validation\Data\__construct
__construct(VocabulariesInterface $vocabularies)
Definition:
VocabularyBridge.php:31
ILIAS\Refinery\ConstraintViolationException
Definition:
ConstraintViolationException.php:29
$txt
$txt
Definition:
error.php:14
ILIAS\Refinery\ConstraintViolationException\__construct
__construct(string $message, string $languageId,... $languageValues)
Construct a violation on a constraint.
Definition:
ConstraintViolationException.php:41
ILIAS\Refinery\ConstraintViolationException\getTranslatedMessage
getTranslatedMessage(callable $txt)
Definition:
ConstraintViolationException.php:52
$message
$message
Definition:
xapiexit.php:32
ILIAS\Refinery\ConstraintViolationException\$languageValues
array $languageValues
Definition:
ConstraintViolationException.php:32
src
Refinery
ConstraintViolationException.php
Generated on Wed Sep 10 2025 14:12:06 for ILIAS by
1.8.13 (using
Doxyfile
)