Overview

Namespaces

  • PHP
  • ProgrammingAreHard
    • Arbiter
      • Domain
      • Model
  • Symfony
    • Component
      • Security
        • Acl
          • Exception
          • Model
          • Permission
        • Core
          • User

Classes

  • ChainUserProvider
  • InMemoryUserProvider
  • User
  • UserChecker

Interfaces

  • AdvancedUserInterface
  • EquatableInterface
  • UserCheckerInterface
  • UserInterface
  • UserProviderInterface
  • Overview
  • Namespace
  • Class
  • Tree

Class InMemoryUserProvider

InMemoryUserProvider is a simple non persistent user provider.

Useful for testing, demonstration, prototyping, and for simple needs (a backend with a unique admin for instance)

Symfony\Component\Security\Core\User\InMemoryUserProvider implements Symfony\Component\Security\Core\User\UserProviderInterface
Namespace: Symfony\Component\Security\Core\User
Author: Fabien Potencier <fabien@symfony.com>
Located at InMemoryUserProvider.php
Methods summary
public
# __construct( array $users = array() )

Constructor.

Constructor.

The user array is a hash where the keys are usernames and the values are an array of attributes: 'password', 'enabled', and 'roles'.

Parameters

$users
array
$users An array of users
public
# createUser( Symfony\Component\Security\Core\User\UserInterface $user )

Adds a new User to the provider.

Adds a new User to the provider.

Parameters

$user
Symfony\Component\Security\Core\User\UserInterface
$user A UserInterface instance

Throws

LogicException
public Symfony\Component\Security\Core\User\UserInterface
# loadUserByUsername( string $username )

Loads the user for the given username.

Loads the user for the given username.

Parameters

$username
string
$username The username

Returns

Symfony\Component\Security\Core\User\UserInterface

Throws

Symfony\Component\Security\Core\Exception\UsernameNotFoundException
if the user is not found

Implementation of

Symfony\Component\Security\Core\User\UserProviderInterface::loadUserByUsername()
public Symfony\Component\Security\Core\User\UserInterface
# refreshUser( Symfony\Component\Security\Core\User\UserInterface $user )

Refreshes the user for the account interface.

Refreshes the user for the account interface.

Parameters

$user
Symfony\Component\Security\Core\User\UserInterface
$user

Returns

Symfony\Component\Security\Core\User\UserInterface

Throws

Symfony\Component\Security\Core\Exception\UnsupportedUserException
if the account is not supported

Implementation of

Symfony\Component\Security\Core\User\UserProviderInterface::refreshUser()
public boolean
# supportsClass( string $class )

Whether this provider supports the given user class

Whether this provider supports the given user class

Parameters

$class
string
$class

Returns

boolean

Implementation of

Symfony\Component\Security\Core\User\UserProviderInterface::supportsClass()
Arbiter API documentation generated by ApiGen 2.8.0