66use  HMS \Auth \PasswordStore ;
77use  Illuminate \Database \Seeder ;
88use  HMS \Repositories \RoleRepository ;
9- use  LaravelDoctrine \ORM \Facades \ EntityManager ;
9+ use  Doctrine \ORM \EntityManagerInterface ;
1010
1111class  UserTableSeeder extends  Seeder
1212{
@@ -35,16 +35,23 @@ class UserTableSeeder extends Seeder
3535     */ 
3636    protected  $ passwordStore
3737
38+     /** 
39+      * @var EntityManagerInterface 
40+      */ 
41+     protected  $ entityManager
42+ 
3843    /** 
3944     * Create a new TableSeeder instance. 
4045     * 
4146     * @param RoleRepository $roleRepository 
4247     * @param PasswordStore  $passwordStore 
48+      * @param EntityManagerInterface $entityManager 
4349     */ 
44-     public  function  __construct (RoleRepository $ roleRepositoryPasswordStore $ passwordStore
50+     public  function  __construct (RoleRepository $ roleRepositoryPasswordStore $ passwordStore,  EntityManagerInterface   $ entityManager 
4551    {
4652        $ this roleRepository  = $ roleRepository
4753        $ this passwordStore  = $ passwordStore
54+         $ this entityManager  = $ entityManager
4855    }
4956
5057    /** 
@@ -75,7 +82,7 @@ public function run()
7582            ->each (function  ($ u
7683                $ ugetRoles ()->add ($ this roleRepository ->findOneByName (Role::MEMBER_CURRENT ));
7784                $ this passwordStore ->add ($ ugetUsername (), 'password ' );
78-                 EntityManager:: persist ($ u
85+                 $ this -> entityManager -> persist ($ u
7986            });
8087
8188        // create all the other types 
@@ -85,7 +92,7 @@ public function run()
8592                ->each (function  ($ uuse  ($ role
8693                    $ ugetRoles ()->add ($ this roleRepository ->findOneByName ($ role
8794                    $ this passwordStore ->add ($ ugetUsername (), 'password ' );
88-                     EntityManager:: persist ($ u
95+                     $ this -> entityManager -> persist ($ u
8996                });
9097        }
9198
@@ -95,9 +102,9 @@ public function run()
95102            $ admingetRoles ()->add ($ this roleRepository ->findOneByName (Role::SUPERUSER ));
96103            $ adminsetEmailVerifiedAt (new  Carbon );
97104            $ this passwordStore ->add ($ admingetUsername (), 'admin ' );
98-             EntityManager:: persist ($ admin
105+             $ this -> entityManager -> persist ($ admin
99106        }
100107
101-         EntityManager:: flush ();
108+         $ this -> entityManager -> flush ();
102109    }
103110}
0 commit comments