File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed
Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -161,16 +161,11 @@ public function processNewResource(EntityResource $resource)
161161 */
162162 public function rebuildAuthorizations ()
163163 {
164- $ authorizationRepository = $ this ->entityManager ->getRepository ('MyCLabs\ACL\Model\Authorization ' );
165164 $ roleRepository = $ this ->entityManager ->getRepository ('MyCLabs\ACL\Model\Role ' );
166165
167166 // Clear
168- // TODO use DQL DELETE query
169- foreach ($ authorizationRepository ->findAll () as $ authorization ) {
170- $ this ->entityManager ->remove ($ authorization );
171- }
172- $ this ->entityManager ->flush ();
173- $ this ->entityManager ->clear ();
167+ $ this ->entityManager ->createQuery ('DELETE MyCLabs\ACL\Model\Authorization ' );
168+ $ this ->entityManager ->clear ('MyCLabs\ACL\Model\Authorization ' );
174169
175170 // Regenerate
176171 foreach ($ roleRepository ->findAll () as $ role ) {
You can’t perform that action at this time.
0 commit comments