Overview

Namespaces

  • CRUDlex

Classes

  • PasswordReset
  • User
  • UserProvider
  • UserSetup
  • Overview
  • Namespace
  • Class

Class UserProvider

The implementation of the UserProviderInterface to work with the CRUDlex API.

CRUDlex\UserProvider implements Symfony\Component\Security\Core\User\UserProviderInterface
Namespace: CRUDlex
Located at UserProvider.php
Methods summary
protected string[]
# loadUserRolesViaData( mixed $userId )

Loads the roles of an user via an AbstractData instance.

Loads the roles of an user via an AbstractData instance.

Parameters

$userId
the id of the user

Returns

string[]
the roles of the user
protected string[]
# loadUserRolesViaManyToMany( Entity $user )

Loads the roles of an user via a many-to-many relationship

Loads the roles of an user via a many-to-many relationship

Parameters

$user
the id of the user

Returns

string[]
the roles of the user
public
# __construct( CRUDlex\Service $service, string $userIdentifier = 'user', string $userRoleIdentifier = 'roles', string $usernameField = 'username', string $passwordField = 'password', string $saltField = 'salt' )

Constructor for data structures connecting users and roles via a many-to-many relationship on the user.

Constructor for data structures connecting users and roles via a many-to-many relationship on the user.

Parameters

$service
the Service instance to take the AbstractData of the users from
$userIdentifier
the identifier to of the user AbstractData
$userRoleIdentifier
the field of the many-to-many relationship to grab the user role data from or the AbstractData if its an own entity
$usernameField
the Entity fieldname of the username
$passwordField
the Entity fieldname of the password hash
$saltField
the Entity fieldname of the password hash salt
public CRUDlex\User
# loadUserByUsername( string $username )

Loads and returns an user by username. Throws an UsernameNotFoundException on not existing username.

Loads and returns an user by username. Throws an UsernameNotFoundException on not existing username.

Parameters

$username
the username

Returns

CRUDlex\User
the loaded user
public CRUDlex\User
# refreshUser( Symfony\Component\Security\Core\User\UserInterface $user )

Reloads and returns the given user. Throws an UsernameNotFoundException if the user ceased to exist meanwhile.

Reloads and returns the given user. Throws an UsernameNotFoundException if the user ceased to exist meanwhile.

Parameters

$user
the user to reload

Returns

CRUDlex\User
the reloaded user
public boolean
# supportsClass( string $class )

Tests whether the given user class is supported by this UserProvider.

Tests whether the given user class is supported by this UserProvider.

Parameters

$class
the user class name to test

Returns

boolean
true if the class is "CRUDlex\User"
Properties summary
protected $usernameField

The Entity fieldname of the username.

The Entity fieldname of the username.

#
protected $passwordField

The fieldname of the password (hash).

The fieldname of the password (hash).

#
protected $saltField

The fieldname of the password hash salt.

The fieldname of the password hash salt.

#
protected $userData

Holds the AbstractData instance to grab the user data from.

Holds the AbstractData instance to grab the user data from.

#
protected $userRoleData

Holds the AbstractData instance or the field of the many-to-many relationship to grab the user role data from.

Holds the AbstractData instance or the field of the many-to-many relationship to grab the user role data from.

#
protected $userRoleIdentifier

Holds the AbstractData instance or the field of the many-to-many relationship to grab the user role data from.

Holds the AbstractData instance or the field of the many-to-many relationship to grab the user role data from.

#
CRUDlexUser API API documentation generated by ApiGen