public function evaluate(APILimitationValue $value, UserReference $currentUser, ValueObject $object, array $targets = null)
    {
        if (!$value instanceof APITagLimitation) {
            throw new InvalidArgumentException('$value', 'Must be of type: TagLimitation');
        }

        if (!$object instanceof Tag) {
            throw new InvalidArgumentException('$object', 'Must be of type: Tag');
        }

        if (empty($value->limitationValues)) {
            return false;
        }

        $limitationValues = array_map(
            static function ($value) {
                return (int) $value;
            },
            $value->limitationValues
        );

        return in_array($object->id, $limitationValues, true);
    }
public function evaluate(APILimitationValue $value, UserReference $currentUser, ValueObject $object, array $targets = null)
    {
        if (!$value instanceof APITagLimitation) {
            throw new InvalidArgumentException('$value', 'Must be of type: TagLimitation');
        }

        if (!$object instanceof Tag) {
            throw new InvalidArgumentException('$object', 'Must be of type: Tag');
        }

        if (empty($value->limitationValues)) {
            return false;
        }

        $limitationValues = array_map(
            static function ($value) {
                return (int) $value;
            },
            $value->limitationValues
        );

        return in_array($object->id, $limitationValues, true);
    }
public function evaluate ( APILimitationValue $ value , UserReference $ currentUser , ValueObject $ object , array $ targets = null ) { if ( ! $ value instanceof APITagLimitation ) { throw new InvalidArgumentException ( '$value' , 'Must be of type: TagLimitation' ) ; } if ( ! $ object instanceof Tag ) { throw new InvalidArgumentException ( '$object' , 'Must be of type: Tag' ) ; } if ( empty ( $ value -> limitationValues ) ) { return false ; } $ limitationValues = array_map ( static function ( $ value ) { return ( int ) $ value ; } , $ value -> limitationValues ) ; return in_array ( $ object -> id , $ limitationValues , true ) ; }
Evaluate permission against content and placement.

@param \eZ\Publish\API\Repository\Values\User\Limitation $value
@param \eZ\Publish\API\Repository\Values\User\UserReference $currentUser
@param \eZ\Publish\API\Repository\Values\ValueObject $object
@param \eZ\Publish\API\Repository\Values\ValueObject[]|null $targets An array of location, parent or "assignment"
objects, if null: none where provided by caller

@throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException If any of the arguments are invalid
Example: If LimitationValue is instance of ContentTypeLimitationValue, and Type is SectionLimitationType
@throws \eZ\Publish\API\Repository\Exceptions\BadStateException If value of the LimitationValue is unsupported
Example if OwnerLimitationValue->limitationValues[0] is not one of: [ 1,  2 ]

@return bool
Evaluate permission against content and placement .