PHP Interface FOS\UserBundle\Model\UserManagerInterface

All changes to users should happen through this interface. The class also contains ACL annotations which will only work if you have the SecurityExtraBundle installed, otherwise they will simply be ignored.
Author: Gordon Franke ([email protected])
Author: Thibault Duplessis ([email protected])
Author: Johannes M. Schmitt ([email protected])
Show file Open project: KnpLabs/KnpUserBundle Interface Usage Examples

Public Methods

Method Description
createUser ( ) : User Creates an empty user instance
deleteUser ( FOS\UserBundle\Model\UserInterface $user ) : void Deletes a user
findUserBy ( array $criteria ) : User Finds one user by the given criteria
findUserByConfirmationToken ( string $token ) : User Find a user by its confirmationToken
findUserByEmail ( string $email ) : User Find a user by its email
findUserByUsername ( string $username ) : User Find a user by its username
findUserByUsernameOrEmail ( string $usernameOrEmail ) : User Find a user by its username or email
findUsers ( ) : Traversable Returns a collection with all user instances
getClass ( ) : string Returns the user's fully qualified class name
updateCanonicalFields ( FOS\UserBundle\Model\UserInterface $user ) : void Updates the canonical username and email fields for a user
updatePassword ( FOS\UserBundle\Model\UserInterface $user ) : void Updates a user password if a plain password is set
updateUser ( FOS\UserBundle\Model\UserInterface $user ) : void Updates a user
validateUnique ( FOS\UserBundle\Model\UserInterface $value, Constraint $constraint ) : boolean Checks the uniqueness of the given fields, returns true if its unique

Method Details

createUser() public method

Creates an empty user instance
public createUser ( ) : User
return User

deleteUser() public method

Deletes a user
public deleteUser ( FOS\UserBundle\Model\UserInterface $user ) : void
$user FOS\UserBundle\Model\UserInterface
return void

findUserBy() public method

Finds one user by the given criteria
public findUserBy ( array $criteria ) : User
$criteria array
return User

findUserByConfirmationToken() public method

Find a user by its confirmationToken
public findUserByConfirmationToken ( string $token ) : User
$token string
return User or null if user does not exist

findUserByEmail() public method

Find a user by its email
public findUserByEmail ( string $email ) : User
$email string
return User or null if user does not exist

findUserByUsername() public method

Find a user by its username
public findUserByUsername ( string $username ) : User
$username string
return User or null if user does not exist

findUserByUsernameOrEmail() public method

Find a user by its username or email
public findUserByUsernameOrEmail ( string $usernameOrEmail ) : User
$usernameOrEmail string
return User or null if user does not exist

findUsers() public method

Returns a collection with all user instances
public findUsers ( ) : Traversable
return Traversable

getClass() public method

Returns the user's fully qualified class name
public getClass ( ) : string
return string

updateCanonicalFields() public method

Updates the canonical username and email fields for a user
public updateCanonicalFields ( FOS\UserBundle\Model\UserInterface $user ) : void
$user FOS\UserBundle\Model\UserInterface
return void

updatePassword() public method

Updates a user password if a plain password is set
public updatePassword ( FOS\UserBundle\Model\UserInterface $user ) : void
$user FOS\UserBundle\Model\UserInterface
return void

updateUser() public method

Updates a user
public updateUser ( FOS\UserBundle\Model\UserInterface $user ) : void
$user FOS\UserBundle\Model\UserInterface
return void

validateUnique() public method

Checks the uniqueness of the given fields, returns true if its unique
public validateUnique ( FOS\UserBundle\Model\UserInterface $value, Constraint $constraint ) : boolean
$value FOS\UserBundle\Model\UserInterface
$constraint Symfony\Component\Validator\Constraint
return boolean