/**
  * Sets staff user that creates the time track.
  *
  * @param kyStaff $creator_staff Staff user that creates the time track.
  * @return kyTicketTimeTrack
  */
 public function setCreatorStaff($creator_staff)
 {
     $this->creator_staff = ky_assure_object($creator_staff, 'kyStaff');
     $this->creator_staff_id = $this->creator_staff !== null ? $this->creator_staff->getId() : null;
     $this->creator_staff_name = $this->creator_staff !== null ? $this->creator_staff->getFullName() : null;
     return $this;
 }
示例#2
0
 /**
  * Sets staff user, the creator of this ticket.
  *
  * @param kyStaff $staff Staff user.
  * @return kyTicketPost
  */
 public function setStaff($staff)
 {
     $this->staff = ky_assure_object($staff, 'kyStaff');
     $this->staff_id = $this->staff !== null ? $this->staff->getId() : null;
     $this->creator = $this->staff !== null ? self::CREATOR_STAFF : null;
     if ($this->staff !== null) {
         $this->full_name = $this->staff->getFullName();
         $this->email = $this->staff->getEmail();
     }
     $this->user_id = null;
     $this->user = null;
     return $this;
 }
示例#3
0
 /**
  * Sets creator of this note.
  *
  * @param kyStaff|int|string $creator Staff OR Staff identifier OR creator name (if the ticket is to be created without providing a staff user, ex: System messages, Alerts etc.).
  * @return kyTicketNote
  */
 public function setCreator($creator)
 {
     if ($creator instanceof kyStaff) {
         $this->creator_staff = $creator;
         $this->creator_staff_id = $creator->getId();
         $this->creator_staff_name = $creator->getFullName();
     } elseif (is_numeric($creator)) {
         $this->creator_staff = null;
         $this->creator_staff_id = $creator->getId();
         $this->creator_staff_name = null;
     } else {
         $this->creator_staff = null;
         $this->creator_staff_id = null;
         $this->creator_staff_name = $creator !== null ? strval($creator) : null;
     }
     return $this;
 }