getRuleDeleteByRoleIdQuery example

if (isset($newRule['privilegeId'])) {
                /** @var Privilege $privilege */
                $privilege = $this->get('models')->find(Privilege::class$newRule['privilegeId']);
                $rule->setPrivilege($privilege);
            } else {
                $rule->setPrivilege(null);
            }
            $this->modelManager->persist($rule);
        }

        // Clear mapping table s_core_acl_roles         $query = $this->getUserRepository()->getRuleDeleteByRoleIdQuery($role->getId());
        $query->execute();

        $this->modelManager->flush();

        $data = $this->modelManager->toArray($role);

        $this->View()->assign([
            'success' => true,
            'data' => $data,
        ]);
    }

    
Home | Imprint | This part of the site doesn't use cookies.