I Am Developing website using sonata-admin Bundle in Symfony2
I Have Two Entity UserOne(id,name,pass ...) And UserTwo(id ,user_one_id ,...)
this two table are related by one two many using UserOne(id)->UserTwo(user_one_id)
each records of user_one table are admin of related company and each records of user_two table are employees of related user_one(id) company
user_one ------------------ user_two
1 - james - **** ------------------ 1 - 1 - employee1
2 - kevin - **** ------------------ 2 - 1 - employee2
3 - jack - **** ------------------ 3 - 2 - employee1
when user of user_one table login they get admin panel which is developed using sonata-admin I Have Requirement To Give only that employee of user_two to admin which user_one_id match to login admin means userone(id)
for example if james is login and open dashboard for user management then only employee1 and employee2 is shown
i have created admin class of UserTwo Entity for Admin functionality (UserTwoAdmin.php) but problem is that when james open dashboard all the records of user_two table is shown i want to filter to show only those data which id match to login id