W3cubDocs

/Symfony 2.7

Symfony\Bundle\SecurityBundle\DataCollector\SecurityDataCollector

class SecurityDataCollector extends DataCollector

SecurityDataCollector.

Methods

serialize() from DataCollector
unserialize($data) from DataCollector
__construct(SecurityContextInterface $context = null)
collect(Request $request, Response $response, Exception $exception = null)

Collects data for the given Request and Response.

bool isEnabled()

Checks if security is enabled.

string getUser()

Gets the user.

array getRoles()

Gets the roles of the user.

bool 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

public serialize()

public unserialize($data)

Parameters

$data

public __construct(SecurityContextInterface $context = null)

Parameters

SecurityContextInterface $context

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

public bool isEnabled()

Checks if security is enabled.

Return Value

bool true if security is enabled, false otherwise

public string getUser()

Gets the user.

Return Value

string The user

public array getRoles()

Gets the roles of the user.

Return Value

array The roles

public bool isAuthenticated()

Checks if the user is authenticated or not.

Return Value

bool true if the user is authenticated, false otherwise

public string getTokenClass()

Get the class name of the security token.

Return Value

string The token

public string getName()

Returns the name of the collector.

Return Value

string The collector name

© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/2.7/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.html