Voter
abstractclass Voter implementsVoterInterface,CacheableVoterInterface
Voter is an abstract default implementation of a voter.
Methods
Returns the vote for the given parameters.
Return false if your voter doesn't support the given attribute. Symfony will cache that decision and won't call your voter again for that attribute.
Return false if your voter doesn't support the given subject type. Symfony will cache that decision and won't call your voter again for that subject type.
Determines if the attribute and subject are supported by this voter.
Perform a single access check operation on a given attribute, subject and token.
Details
int
vote(TokenInterface$token,mixed$subject,array$attributes)
Returns the vote for the given parameters.
This method must return one of the following constants: ACCESS_GRANTED, ACCESS_DENIED, or ACCESS_ABSTAIN.
bool
supportsAttribute(string$attribute)
Return false if your voter doesn't support the given attribute. Symfony will cache that decision and won't call your voter again for that attribute.
bool
supportsType(string$subjectType)
Return false if your voter doesn't support the given subject type. Symfony will cache that decision and won't call your voter again for that subject type.
abstractprotectedbool
supports(string$attribute,mixed$subject)
Determines if the attribute and subject are supported by this voter.
abstractprotectedbool
voteOnAttribute(string$attribute,mixed$subject,TokenInterface$token)
Perform a single access check operation on a given attribute, subject and token.
It is safe to assume that $attribute and $subject already passed the "supports()" method check.