Skip to content

Commit

Permalink
Merge pull request #150 from gregorybesson/develop
Browse files Browse the repository at this point in the history
fix ->getQueryUsersByRole
  • Loading branch information
gregorybesson authored Jun 30, 2019
2 parents ebaf3b8 + f46d507 commit e53abd4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/Service/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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();
Expand Down Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions src/View/Helper/UserListWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e53abd4

Please sign in to comment.