for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);
namespace eZ\Publish\Core\Limitation\LanguageLimitation;
use eZ\Publish\API\Repository\Values\Content\VersionInfo;
use eZ\Publish\API\Repository\Values\User\Limitation;
use eZ\Publish\Core\Limitation\LanguageLimitationType;
use eZ\Publish\SPI\Limitation\Target;
* @internal for internal use by LanguageLimitation
final class NewDraftEvaluator implements VersionTargetEvaluator
{
public function accept(Target\Version $targetVersion): bool
return $targetVersion->newStatus === VersionInfo::STATUS_DRAFT;
}
public function evaluate(Target\Version $targetVersion, Limitation $limitationValue): ?bool
return LanguageLimitationType::ACCESS_GRANTED;