CacheableVoterInterface
extends
VoterInterface
in
Let voters expose the attributes and types they care about.
By returning false to either supportsAttribute
or supportsType
, the
voter will never be called for the specified attribute or subject.
Tags
Table of Contents
Constants
- ACCESS_ABSTAIN = 0
- ACCESS_DENIED = -1
- ACCESS_GRANTED = 1
Methods
- supportsAttribute() : bool
- supportsType() : bool
- vote() : int
- Returns the vote for the given parameters.
Constants
ACCESS_ABSTAIN
public
mixed
ACCESS_ABSTAIN
= 0
ACCESS_DENIED
public
mixed
ACCESS_DENIED
= -1
ACCESS_GRANTED
public
mixed
ACCESS_GRANTED
= 1
Methods
supportsAttribute()
public
supportsAttribute(string $attribute) : bool
Parameters
- $attribute : string
Return values
boolsupportsType()
public
supportsType(string $subjectType) : bool
Parameters
- $subjectType : string
-
The type of the subject inferred by
get_class
orget_debug_type
Return values
boolvote()
Returns the vote for the given parameters.
public
vote(TokenInterface $token, mixed $subject, array<string|int, mixed> $attributes) : int
This method must return one of the following constants: ACCESS_GRANTED, ACCESS_DENIED, or ACCESS_ABSTAIN.
Parameters
- $token : TokenInterface
- $subject : mixed
-
The subject to secure
- $attributes : array<string|int, mixed>
-
An array of attributes associated with the method being invoked
Return values
int —either ACCESS_GRANTED, ACCESS_ABSTAIN, or ACCESS_DENIED