Documentation

CacheableVoterInterface extends VoterInterface

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
author

Jérémy Derussé jeremy@derusse.com

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

Methods

supportsAttribute()

public supportsAttribute(string $attribute) : bool
Parameters
$attribute : string
Return values
bool

supportsType()

public supportsType(string $subjectType) : bool
Parameters
$subjectType : string

The type of the subject inferred by get_class or get_debug_type

Return values
bool

vote()

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


        
On this page

Search results