ListUsers
in package
Table of Contents
Constants
- ALLOWED_SORT_COLUMNS = ['username' => 'UsUsername', 'email' => 'UsEmail', 'role' => 'UsRole', 'active' => 'UsIsActive', 'created' => 'UsCreated', 'last_login' => 'UsLastLogin']
- DEFAULT_DIRECTION = 'ASC'
- DEFAULT_SORT = 'UsUsername'
Properties
Methods
- __construct() : mixed
- execute() : User[], total: int, page: int, per_page: int, total_pages: int, statistics: array}
- List users with pagination and optional search.
Constants
ALLOWED_SORT_COLUMNS
private
mixed
ALLOWED_SORT_COLUMNS
= ['username' => 'UsUsername', 'email' => 'UsEmail', 'role' => 'UsRole', 'active' => 'UsIsActive', 'created' => 'UsCreated', 'last_login' => 'UsLastLogin']
DEFAULT_DIRECTION
private
mixed
DEFAULT_DIRECTION
= 'ASC'
DEFAULT_SORT
private
mixed
DEFAULT_SORT
= 'UsUsername'
Properties
$userRepository
private
MySqlUserRepository
$userRepository
Methods
__construct()
public
__construct(MySqlUserRepository $userRepository) : mixed
Parameters
- $userRepository : MySqlUserRepository
execute()
List users with pagination and optional search.
public
execute([int $page = 1 ][, int $perPage = 20 ][, string $sortBy = 'username' ][, string $direction = 'ASC' ][, string $search = '' ]) : User[], total: int, page: int, per_page: int, total_pages: int, statistics: array}
Parameters
- $page : int = 1
-
Page number (1-based)
- $perPage : int = 20
-
Items per page
- $sortBy : string = 'username'
-
Sort column key (from ALLOWED_SORT_COLUMNS)
- $direction : string = 'ASC'
-
Sort direction (ASC or DESC)
- $search : string = ''
-
Optional search query