Thanks for fast answer.
Got it working with service configuration looking like this:
services:
user.provider:
class: Application\UserBundle\Service\UserProvider
arguments:
- @database_connection
where user.provider is id of the service used in security.config.
Argument database_connection passes the configured DBAL connection to
the custom UserProvider class constructor as first argument:
class UserProvider implements UserProviderInterface
{
protected $conn;
public function __construct($db_connection)
{
$this->conn = $db_connection;
}
public function loadUserByUsername($username)
{
//returns user object that implements AccountInterface
$user = new User($this->conn);
return $user->getOneByUsername($username);
}
}
Thanks once more for help.
Michal
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en