'staff_1', 'requestData' => [ 'userId' => [ 'validation' => DataValidator::dataStoreId('user'), 'error' => ERRORS::INVALID_USER ] ] ]; } public function handler() { if(!Controller::isUserSystemEnabled()) { throw new RequestException(ERRORS::USER_SYSTEM_DISABLED); } $userId = Controller::request('userId'); $user = User::getDataStore($userId); $staff = Controller::getLoggedUser(); $tickets = new DataStoreList(); foreach($user->sharedTicketList as $ticket) { if($staff->sharedDepartmentList->includesId($ticket->department->id)) { $tickets->add($ticket); } } Response::respondSuccess([ 'name' => $user->name, 'email' => $user->email, 'signupDate' => $user->signupDate, 'tickets' => $tickets->toArray(), 'verified' => !$user->verificationToken, 'disabled' => !!$user->disabled ]); } }