アプリで複数のユーザー プロバイダーを使用しています。
security:
providers:
chain_provider:
chain:
providers: [entity, json]
entity:
id: myapp.entity.user_provider
json:
id: myapp.json.user_provider
ここで、サービスからユーザーをロードする必要があります
services:
myapp.my.service:
class: AppBundle\Services\My
argument: [@the.defined.chain.provider]
// AppBundle\Services\My
namespace AppBundle\Services;
class My
{
public function loadUser($username)
{
return $this->userProvider->loadUserByUsername($username);
}
}
チェーンプロバイダーを明示的に使用するにはどうすればよいですか?