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

NewDraftEvaluator.php
Go to the documentation of this file.
1 <?php
2
7 declare(strict_types=1);
8
9 namespace eZ\Publish\Core\Limitation\LanguageLimitation;
10
11 use eZ\Publish\API\Repository\Values\Content\VersionInfo;
12 use eZ\Publish\API\Repository\Values\User\Limitation;
13 use eZ\Publish\Core\Limitation\LanguageLimitationType;
14 use eZ\Publish\SPI\Limitation\Target;
15
19 final class NewDraftEvaluator implements VersionTargetEvaluator
20 {
21 public function accept(Target\Version $targetVersion): bool
22 {
23 return $targetVersion->newStatus === VersionInfo::STATUS_DRAFT;
24 }
25
26 public function evaluate(Target\Version $targetVersion, Limitation $limitationValue): ?bool
27 {
28 return LanguageLimitationType::ACCESS_GRANTED;
29 }
30 }
eZ\Publish\API\Repository\Values\Content\VersionInfo
Definition: API/Repository/Values/Content/VersionInfo.php:27
eZ\Publish\API\Repository\Values\Content\VersionInfo\STATUS_DRAFT
const STATUS_DRAFT
Definition: API/Repository/Values/Content/VersionInfo.php:28
eZ\Publish\API\Repository\Values\User\Limitation
This class represents a Limitation applied to a policy.
Definition: API/Repository/Values/User/Limitation.php:15
eZ\Publish\Core\Limitation\LanguageLimitationType
LanguageLimitation is a Content limitation.
Definition: LanguageLimitationType.php:35
eZ\Publish\Core\Limitation\LanguageLimitation\NewDraftEvaluator
Definition: NewDraftEvaluator.php:20
eZ\Publish\Core\Limitation\LanguageLimitation\NewDraftEvaluator\evaluate
evaluate(Target\Version $targetVersion, Limitation $limitationValue)
Definition: NewDraftEvaluator.php:26
eZ\Publish\Core\Limitation\LanguageLimitation\NewDraftEvaluator\accept
accept(Target\Version $targetVersion)
Definition: NewDraftEvaluator.php:21
eZ\Publish\SPI\Limitation\Target\Version
Definition: SPI/Limitation/Target/Version.php:25
eZ\Publish\Core\Limitation\LanguageLimitation\VersionTargetEvaluator
Definition: VersionTargetEvaluator.php:18
eZ\Publish\SPI\Limitation\Target
Marker interface for PermissionResolver::canUser $targets objects.
Definition: SPI/Limitation/Target.php:19
eZ\Publish\SPI\Limitation\Type\ACCESS_GRANTED
const ACCESS_GRANTED
Constants for return value of {.
Definition: SPI/Limitation/Type.php:33
eZ\Publish\API\Repository\Values\User\Limitation
Definition: BlockingLimitation.php:7
eZ\Publish\Core\Limitation\LanguageLimitation
Definition: ContentDeleteEvaluator.php:9
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.