public static newTicketEvent ( $user, $ticket ) : |
||
return |
public static function newTicketEvent($user, $ticket)
{
return new static(['project_id' => $ticket['project_id'], 'owner_type' => 'Ticket', 'owner_id' => $ticket['id'], 'user_id' => $user['id'], 'action' => "ticket_created"]);
}
/** * Create ticket. */ public function createAction() { $ticket = new Ticket($this->ticketParams()); if ($ticket->validate()) { $ticket->save(); Timeline::newTicketEvent($this->currentUser, $ticket)->save(); $this->currentProject->next_ticket_id++; $this->currentProject->save(); return $this->redirectTo('ticket', ['pslug' => $this->currentProject['slug'], 'id' => $ticket->ticket_id]); } return $this->render('tickets/new.phtml', ['ticket' => $ticket]); }