PHP Class FOS\UserBundle\Twig\UserExtension

Inheritance: extends Twig_Extensio\Twig_Extension
Show file Open project: KnpLabs/KnpUserBundle

Protected Properties

Property Type Description
$securityContext

Public Methods

Method Description
__construct ( SecurityContext $securityContext )
getFunctions ( ) : array Returns a list of global functions to add to the existing list.
getName ( ) : string Returns the name of the extension.
getUser ( ) : FOS\UserBundle\Model\User Returns the authenticated user, if any
isAnonymous ( ) : boolean Tell whether or not the user is anonymous
isAuthenticated ( ) : boolean Tell whether or not a user is logged in
isUser ( User $user ) : boolean Tells whether the authenticated user is this user

Method Details

__construct() public method

public __construct ( SecurityContext $securityContext )
$securityContext Symfony\Component\Security\Core\SecurityContext

getFunctions() public method

Returns a list of global functions to add to the existing list.
public getFunctions ( ) : array
return array An array of global functions

getName() public method

Returns the name of the extension.
public getName ( ) : string
return string The extension name

getUser() public method

Returns the authenticated user, if any
public getUser ( ) : FOS\UserBundle\Model\User
return FOS\UserBundle\Model\User

isAnonymous() public method

Tell whether or not the user is anonymous
public isAnonymous ( ) : boolean
return boolean

isAuthenticated() public method

Tell whether or not a user is logged in
public isAuthenticated ( ) : boolean
return boolean

isUser() public method

Tells whether the authenticated user is this user
public isUser ( User $user ) : boolean
$user User
return boolean

Property Details

$securityContext protected property

protected $securityContext