/**
  * Sets the ticket post this attachment will be attached to.
  *
  * Automatically sets the ticket.
  *
  * @param kyTicketPost $ticket_post Ticket post.
  */
 public function setTicketPost($ticket_post)
 {
     $this->ticket_post = ky_assure_object($ticket_post, 'kyTicketPost');
     $this->ticket_post_id = $this->ticket_post !== null ? $this->ticket_post->getId() : null;
     $this->ticket = $this->ticket_post !== null ? $this->ticket_post->getTicket() : null;
     $this->ticket_id = $this->ticket !== null ? $this->ticket->getId() : null;
 }
 /**
  * Sets the ticket that the post will be connected with.
  *
  * @param kyTicket $ticket Ticket.
  * @return kyTicketPost
  */
 public function setTicket($ticket)
 {
     $this->ticket = ky_assure_object($ticket, 'kyTicket');
     $this->ticket_id = $this->ticket !== null ? $this->ticket->getId() : null;
     return $this;
 }
 /**
  * Creates new ticket time track.
  * WARNING: Data is not sent to Kayako unless you explicitly call create() on this method's result.
  *
  * @param kyTicket $ticket Ticket to attach the timetrack to.
  * @param string $contents Note contents.
  * @param kyStaff $staff Staff user - both creator and worker.
  * @param string $time_worked Worked time formatted as hh:mm. Work date will be set to current datetime.
  * @param string $time_billable Billable time formatted as hh:mm. Bill date will be set to current datetime.
  * @return kyTicketTimeTrack
  */
 public static function createNew(kyTicket $ticket, $contents, kyStaff $staff, $time_worked, $time_billable)
 {
     $ticket_time_track = new self();
     $ticket_time_track->setTicketId($ticket->getId());
     $ticket_time_track->setContents($contents);
     $ticket_time_track->setCreatorStaff($staff);
     $ticket_time_track->setWorkerStaff($staff);
     $ticket_time_track->setBillingData($time_billable);
     $ticket_time_track->setWorkedData($time_worked);
     return $ticket_time_track;
 }
Beispiel #4
0
 /**
  * Creates new ticket note.
  * WARNING: Data is not sent to Kayako unless you explicitly call create() on this method's result.
  *
  * @param kyTicket $ticket Ticket in which to create the post.
  * @param kyStaff $creator Creator (staff) of new note.
  * @param string $contents Contents of new note.
  * @return kyTicketNote
  */
 public static function createNew(kyTicket $ticket, kyStaff $creator, $contents)
 {
     $new_ticket_note = new kyTicketNote();
     $new_ticket_note->setTicketId($ticket->getId());
     $new_ticket_note->setCreator($creator);
     $new_ticket_note->setContents($contents);
     return $new_ticket_note;
 }