From f46d50739a363cbfe1efd3543f4b6706fd39d9b2 Mon Sep 17 00:00:00 2001 From: Greg Besson Date: Sun, 30 Jun 2019 22:58:40 +0200 Subject: [PATCH] fix ->getQueryUsersByRole --- src/Service/User.php | 8 ++++---- src/View/Helper/UserListWidget.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Service/User.php b/src/Service/User.php index 6fd77d1..7f52508 100644 --- a/src/Service/User.php +++ b/src/Service/User.php @@ -906,7 +906,7 @@ public function getQueryUsersByRole($role = null, $order = null, $search = '', $ public function getArrayUsersByRole($role = null, $order = null, $search = '') { - $query = $this->getQueryUsersByRole($role, $order, $search); + $qb = $this->getQueryUsersByRole($role, $order, $search); $users = array( array( 'id' => 1, @@ -929,7 +929,7 @@ public function getArrayUsersByRole($role = null, $order = null, $search = '') 'team' => 1 ) ); - foreach ($query->getResult() as $user) { + foreach ($qb->getQuery()->getResult() as $user) { $a = array(); $a[] = $user->getId(); $a[] = $user->getUsername(); @@ -978,8 +978,8 @@ public function getArrayUsersByRole($role = null, $order = null, $search = '') public function getUsersByRole($role = 1, $order = 'DESC', $search = '') { - $query = $this->getQueryUsersByRole($role, $order, $search); - $result = $query->getResult(); + $qb = $this->getQueryUsersByRole($role, $order, $search); + $result = $qb->getQuery()->getResult(); return $result; } diff --git a/src/View/Helper/UserListWidget.php b/src/View/Helper/UserListWidget.php index 075f9cb..ef6e6c5 100644 --- a/src/View/Helper/UserListWidget.php +++ b/src/View/Helper/UserListWidget.php @@ -26,8 +26,8 @@ public function __construct(\PlaygroundUser\Service\User $userService) */ public function __invoke($roleId = 1, $order = null, $search = null, $filterField = null, $filterValue = null) { - $query = $this->getUserService()->getQueryUsersByRole($roleId, $order, $search, $filterField, $filterValue); - $users = $query->getResult(); + $qb = $this->getUserService()->getQueryUsersByRole($roleId, $order, $search, $filterField, $filterValue); + $users = $qb->getQuery()->getResult(); return $users; }