/** * Sets the creator of this comment. * * @param kyUser|kyStaff|string $creator Creator (staff object, user object or user fullname) of this comment. * @return $this */ public function setCreator($creator) { if ($creator instanceof kyStaff) { $this->creator_staff = $creator; $this->creator_id = $this->creator_staff->getId(); $this->creator_type = self::CREATOR_TYPE_STAFF; $this->creator_user = null; } elseif ($creator instanceof kyUser) { $this->creator_user = $creator; $this->creator_id = $this->creator_user->getId(); $this->creator_type = self::CREATOR_TYPE_USER; $this->creator_staff = null; } elseif (is_string($creator) && strlen($creator) > 0) { $this->setCreatorFullname($creator); } else { $this->creator_id = null; $this->creator_type = null; $this->creator_staff = null; $this->creator_user = null; } return $this; }
/** * Sets staff user, owner of this ticket. * * @param kyStaff $owner_staff Staff user. * @return kyTicket */ public function setOwnerStaff($owner_staff) { $this->owner_staff = ky_assure_object($owner_staff, 'kyStaff'); $this->owner_staff_id = $this->owner_staff !== null ? $this->owner_staff->getId() : null; return $this; }
/** * Sets staff user, the editor of this news item update. * * @param kyStaff $staff Staff user. * @return kyNewsItem */ public function setEditedStaff($staff) { $this->edited_staff = ky_assure_object($staff, 'kyStaff'); $this->edited_staff_id = $this->edited_staff !== null ? $this->edited_staff->getId() : null; return $this; }
/** * Sets staff user, the creator of this knowledgebase article. * * @param kyStaff $staff Staff user. * @return kyKnowledgebaseArticle */ public function setStaff($creator) { $this->creator = ky_assure_object($creator, 'kyStaff'); $this->creator_id = $this->creator !== null ? $this->creator->getId() : null; return $this; }
/** * Sets staff user, the creator of this post. * * @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; $this->user_id = null; $this->user = null; return $this; }
/** * 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; }
/** * Sets the staff who this note is for. * * @param kyStaff $for_staff * @return kyTicketNote */ public function setForStaff($for_staff) { $this->for_staff = $for_staff instanceof kyStaff ? $for_staff : null; $this->for_staff_id = $this->for_staff !== null ? $this->for_staff->getId() : null; return $this; }