Silex security provider
I have a class UserMapper <?php namespace Models; use Symfony\Component\Security\Core\User\UserProviderInterface; use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Core\Exception\UnsupportedUserException; use Symfony\Component\Security\Core\Exception\UsernameNotFoundException; use \PDO; class UserMapper implements UserProviderInterface { /** * Database connection. */ var $db = NULL; /** * Constructor function. Loads model from database if the id is known. * * @param $db * Database connection */ function __construct() { $this->db = ConnectionProvider: