'user', 'requestData' => [ 'title' => [ 'validation' => DataValidator::notBlank()->length(1, 200), 'error' => ERRORS::INVALID_TITLE ], 'ticketNumber' => [ 'validation' => DataValidator::validTicketNumber(), 'error' => ERRORS::INVALID_TICKET ] ] ]; } public function handler() { $user = Controller::getLoggedUser(); $newtitle = Controller::request('title'); $ticket = Ticket::getByTicketNumber(Controller::request('ticketNumber')); if(!$user->canManageTicket($ticket)) { throw new RequestException(ERRORS::NO_PERMISSION); } $ticket->title = $newtitle; $ticket->editedTitle = true; $ticket->store(); $ticketNumber = $ticket->ticketNumber; Log::createLog('EDIT_TITLE', $ticketNumber); Response::respondSuccess(); } }