'staff_1', 'requestData' => [ 'ticketNumber' => [ 'validation' => DataValidator::validTicketNumber(), 'error' => ERRORS::INVALID_TICKET ] ] ]; } public function handler() { $ticketNumber = Controller::request('ticketNumber'); $user = Controller::getLoggedUser(); $ticket = Ticket::getByTicketNumber($ticketNumber); if($ticket->owner && $ticket->owner->id == $user->id) { $user->sharedTicketList->remove($ticket); $user->store(); $ticket->owner = null; $ticket->unread = true; $event = Ticketevent::getEvent(Ticketevent::UN_ASSIGN); $event->setProperties(array( 'authorStaff' => $user, 'date' => Date::getCurrentDate() )); $ticket->addEvent($event); $ticket->store(); Response::respondSuccess(); } else { Response::respondError(ERRORS::NO_PERMISSION); return; } } }