This is a simple example, given on http://symfony.com/doc/current/cookbook/security/entity_provider.html