public function validateLimitation(Limitation $limitation)
    {
        $identifier = $limitation->getIdentifier();
        if (!isset($this->settings['limitationTypes'][$identifier])) {
            throw new BadStateException(
                '$identifier',
                "limitationType[{$identifier}] is not configured"
            );
        }

        /**
         * @var \eZ\Publish\SPI\Limitation\Type
         */
        $type = $this->settings['limitationTypes'][$identifier];

        // This will throw if it does not pass
        $type->acceptValue($limitation);

        // This return array of validation errors
        return $type->validate($limitation);
    }
public function validateLimitation(Limitation $limitation)
    {
        $identifier = $limitation->getIdentifier();
        if (!isset($this->settings['limitationTypes'][$identifier])) {
            throw new BadStateException(
                '$identifier',
                "limitationType[{$identifier}] is not configured"
            );
        }

        /**
         * @var \eZ\Publish\SPI\Limitation\Type
         */
        $type = $this->settings['limitationTypes'][$identifier];

        // This will throw if it does not pass
        $type->acceptValue($limitation);

        // This return array of validation errors
        return $type->validate($limitation);
    }
public function validateLimitation ( Limitation $ limitation ) { $ identifier = $ limitation -> getIdentifier ( ) ; if ( ! isset ( $ this -> settings [ 'limitationTypes' ] [ $ identifier ] ) ) { throw new BadStateException ( '$identifier' , "limitationType[{$identifier}] is not configured" ) ; } /**
         * @var \eZ\Publish\SPI\Limitation\Type
         */ $ type = $ this -> settings [ 'limitationTypes' ] [ $ identifier ] ; // This will throw if it does not pass $ type -> acceptValue ( $ limitation ) ; // This return array of validation errors return $ type -> validate ( $ limitation ) ; }
Validates single Limitation.

@throws \eZ\Publish\Core\Base\Exceptions\BadStateException If the Role settings is in a bad state

@param \eZ\Publish\API\Repository\Values\User\Limitation $limitation

@return \eZ\Publish\Core\FieldType\ValidationError[]
Validates single Limitation .