Symfony2 API
Class

Symfony\Bundle\SecurityBundle\DataCollector\SecurityDataCollector

class SecurityDataCollector extends DataCollector

SecurityDataCollector.

Methods

__construct(SecurityContextInterface $context = null)

collect(Request $request, Response $response, Exception $exception = null)

Collects data for the given Request and Response.

Boolean isEnabled()

Checks if security is enabled.

string getUser()

Gets the user.

array getRoles()

Gets the roles of the user.

Boolean isAuthenticated()

Checks if the user is authenticated or not.

string getTokenClass()

Get the class name of the security token.

string getName()

Returns the name of the collector.

Details

at line 28
public __construct(SecurityContextInterface $context = null)

Parameters

SecurityContextInterface $context

at line 36
public collect(Request $request, Response $response, Exception $exception = null)

Collects data for the given Request and Response.

Parameters

Request $request A Request instance
Response $response A Response instance
Exception $exception An Exception instance

at line 70
public Boolean isEnabled()

Checks if security is enabled.

Return Value

Boolean true if security is enabled, false otherwise

at line 80
public string getUser()

Gets the user.

Return Value

string The user

at line 90
public array getRoles()

Gets the roles of the user.

Return Value

array The roles

at line 100
public Boolean isAuthenticated()

Checks if the user is authenticated or not.

Return Value

Boolean true if the user is authenticated, false otherwise

at line 110
public string getTokenClass()

Get the class name of the security token.

Return Value

string The token

at line 118
public string getName()

Returns the name of the collector.

Return Value

string The collector name