1 | <?php |
||
22 | class LimitationService |
||
23 | { |
||
24 | /** @var \eZ\Publish\SPI\Limitation\Type[] */ |
||
25 | private $limitationTypes; |
||
26 | |||
27 | public function __construct(Traversable $limitationTypes = null) |
||
33 | |||
34 | /** |
||
35 | * Returns the LimitationType registered with the given identifier. |
||
36 | * |
||
37 | * Returns the correct implementation of API Limitation value object |
||
38 | * based on provided identifier |
||
39 | * |
||
40 | * @throws \eZ\Publish\Core\Base\Exceptions\NotFound\LimitationNotFoundException |
||
41 | */ |
||
42 | public function getLimitationType(string $identifier): Type |
||
50 | |||
51 | /** |
||
52 | * Validates an array of Limitations. |
||
53 | * |
||
54 | * @param \eZ\Publish\API\Repository\Values\User\Limitation[] $limitations |
||
55 | * |
||
56 | * @return \eZ\Publish\SPI\FieldType\ValidationError[][] |
||
57 | * |
||
58 | * @throws \eZ\Publish\API\Repository\Exceptions\BadStateException |
||
59 | * @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
||
60 | */ |
||
61 | public function validateLimitations(array $limitations): array |
||
73 | |||
74 | /** |
||
75 | * Validates single Limitation. |
||
76 | * |
||
77 | * @return \eZ\Publish\SPI\FieldType\ValidationError[] |
||
78 | * |
||
79 | * @throws \eZ\Publish\API\Repository\Exceptions\BadStateException If the Role settings is in a bad state*@throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
||
80 | * @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
||
81 | */ |
||
82 | public function validateLimitation(Limitation $limitation): array |
||
100 | } |
||
101 |