示例#1
0
 /**
  * Sets user, the creator of this post.
  *
  * @param kyUser $user User.
  * @return kyTicketPost
  */
 public function setUser($user)
 {
     $this->user = ky_assure_object($user, 'kyUser');
     $this->user_id = $this->user !== null ? $this->user->getId() : null;
     $this->creator = $this->user !== null ? self::CREATOR_USER : null;
     if ($this->user !== null) {
         $this->full_name = $this->user->getFullName();
         $this->email = $this->user->getEmail();
     }
     $this->staff_id = null;
     $this->staff = null;
     return $this;
 }