0

symfony2 で PUGXMultiUserBundle と FOSUserBundle を使用しています。

私の問題は、コントローラーの現在のユーザータイプを知りたいことです。

$user = $this->container->get('security.context')->getToken()->getUser();
// now i want to know the user's type for example
if( $user->getType() == "xx") {
 ...... }    

もちろん、属性タイプは存在しません。データベースの PUGXMultiUserBundle によって作成されます。

4

0 に答える 0