protected function parseData($data)
 {
     $this->id = ky_assure_positive_int($data['id']);
     $this->title = ky_assure_string($data['title']);
     $this->visibility_type = ky_assure_string($data['visibilitytype']);
     $this->news_item_count = ky_assure_positive_int($data['newsitemcount'], 0);
 }
 protected function parseData($data)
 {
     $this->id = ky_assure_positive_int($data['id']);
     $this->template_group_id = ky_assure_positive_int($data['tgroupid']);
     $this->user_id = ky_assure_positive_int($data['userid']);
     $this->email = ky_assure_string($data['email']);
     $this->is_validated = ky_assure_bool($data['isvalidated']);
     $this->user_group_id = ky_assure_positive_int($data['usergroupid']);
 }
 /**
  * Sets identifier of parent comment (comment that this comment is a reply to).
  *
  * @param int $parent_comment_id Identifier of parent comment (comment that this comment is a reply to).
  * @return $this
  */
 public function setParentCommentId($parent_comment_id)
 {
     $this->parent_comment_id = ky_assure_positive_int($parent_comment_id);
     $this->parent_comment = null;
     return $this;
 }
 /**
  * Sets identifier of staff user, the editor of this troubleshooterstep item update.
  *
  * @param int $staff_id Staff user identifier.
  * @return kyTroubleshooterStep
  */
 public function setEditedStaffId($staff_id)
 {
     $this->edited_staff_id = ky_assure_positive_int($staff_id);
     $this->edited_staff = null;
     return $this;
 }
 /**
  * Sets identifier of staff user, the creator of this post.
  *
  * @param int $staff_id Staff user identifier.
  * @return kyTicketPost
  */
 public function setStaffId($staff_id)
 {
     $this->staff_id = ky_assure_positive_int($staff_id);
     $this->creator = $this->staff_id > 0 ? self::CREATOR_STAFF : null;
     $this->staff = null;
     $this->user_id = null;
     $this->user = null;
     return $this;
 }
 /**
  * Sets the identifier of staff user that creates the time track.
  *
  * @param int $creator_staff_id Identifier of staff user that creates the time track.
  * @return kyTicketTimeTrack
  */
 public function setCreatorStaffId($creator_staff_id)
 {
     $this->creator_staff_id = ky_assure_positive_int($creator_staff_id);
     $this->creator_staff = null;
     return $this;
 }
 /**
  * Sets KnowledgebaseArticle identifier.
  *
  * @param int $kbarticle_id KnowledgebaseArticle identifier.
  * @return kyKnowledgebaseArticle
  */
 public function setKbarticleId($kbarticle_id)
 {
     $this->kbarticle_id = ky_assure_positive_int($kbarticle_id);
     $this->kbarticle = null;
     return $this;
 }
 /**
  * Sets staff group identifier for the staff user.
  *
  * @param int $staff_group_id Staff group identifier.
  * @return kyStaff
  */
 public function setStaffGroupId($staff_group_id)
 {
     $this->staff_group_id = ky_assure_positive_int($staff_group_id);
     $this->staff_group = null;
     return $this;
 }
 /**
  * Sets identifier of the ticket post this attachment will be attached to.
  * @param int $ticket_post_id Ticket post identifier.
  * @return kyTicketAttachment
  */
 public function setTicketPostId($ticket_post_id)
 {
     $this->ticket_post_id = ky_assure_positive_int($ticket_post_id);
     $this->ticket_post = null;
     return $this;
 }
 protected function parseData($data)
 {
     $this->id = intval($data['id']);
     $this->title = $data['title'];
     $this->display_order = intval($data['displayorder']);
     $this->department_id = ky_assure_positive_int($data['departmentid']);
     $this->display_icon = $data['displayicon'];
     $this->type = $data['type'];
     $this->mark_as_resolved = ky_assure_bool($data['markasresolved']);
     $this->display_count = ky_assure_bool($data['displaycount']);
     $this->status_color = $data['statuscolor'];
     $this->status_bg_color = $data['statusbgcolor'];
     $this->reset_due_time = ky_assure_bool($data['resetduetime']);
     $this->trigger_survey = ky_assure_bool($data['triggersurvey']);
     $this->staff_visibility_custom = ky_assure_bool($data['staffvisibilitycustom']);
     if ($this->staff_visibility_custom && is_array($data['staffgroupid'])) {
         foreach ($data['staffgroupid'] as $staff_group_id) {
             $this->staff_group_ids[] = intval($staff_group_id);
         }
     }
 }
 /**
  * Sets news item identifier.
  *
  * @param int $news_item_id News item identifier.
  * @return kyNewsComment
  */
 public function setNewsItemId($news_item_id)
 {
     $this->news_item_id = ky_assure_positive_int($news_item_id);
     $this->news_item = null;
     return $this;
 }
 /**
  * Sets identifier of the TroubleshooterStep this attachment will belong to.
  *
  * @param int $troubleshooter_step_id TroubleshooterStep identifier.
  * @return kyTroubleshooterAttachment
  */
 public function setTroubleshooterStepId($troubleshooter_step_id)
 {
     $this->troubleshooter_step_id = ky_assure_positive_int($troubleshooter_step_id);
     return $this;
 }
 /**
  * Sets staff Id of the knowledgebase category.
  *
  * @param string $staff_id of the knoledgebase category.
  * @return kyKnowledgebaseCategory
  */
 public function setStaffId($staff_id)
 {
     $this->staff_id = ky_assure_positive_int($staff_id);
     return $this;
 }
 protected function parseData($data)
 {
     $this->id = intval($data['id']);
     $this->title = $data['title'];
     $this->display_order = intval($data['displayorder']);
     $this->department_id = ky_assure_positive_int($data['departmentid']);
     $this->display_icon = $data['displayicon'];
     $this->type = $data['type'];
     $this->user_visibility_custom = ky_assure_bool($data['uservisibilitycustom']);
     if ($this->user_visibility_custom && is_array($data['usergroupid'])) {
         foreach ($data['usergroupid'] as $user_group_id) {
             $this->user_group_ids[] = intval($user_group_id);
         }
     }
 }
 /**
  * Sets categories (using their identifiers) for this news item.
  *
  * @param int[] $category_ids Identifiers of categories for this news item.
  * @return kyNewsItem
  */
 public function setCategoryIds($category_ids)
 {
     //normalization to array
     if (!is_array($category_ids)) {
         if (is_numeric($category_ids)) {
             $category_ids = array($category_ids);
         } else {
             $category_ids = array();
         }
     }
     //normalization to positive integer values
     $this->category_ids = array();
     foreach ($category_ids as $category_id) {
         $category_id = ky_assure_positive_int($category_id);
         if ($category_id === null) {
             continue;
         }
         $this->category_ids[] = $category_id;
     }
     return $this;
 }
Exemple #16
0
 /**
  * Sets expiration date of Service Level Agreement plan assignment.
  *
  * @see http://www.php.net/manual/en/function.strtotime.php
  *
  * @param string|int|null $sla_plan_expiry Date and time when Service Level Agreement plan for this user will expire (timestamp or string format understood by PHP strtotime). Null to disable expiration.
  * @return kyUser
  */
 public function setSLAPlanExpiry($sla_plan_expiry)
 {
     $this->sla_plan_expiry = is_numeric($sla_plan_expiry) || $sla_plan_expiry === null ? ky_assure_positive_int($sla_plan_expiry) : strtotime($sla_plan_expiry);
     return $this;
 }
Exemple #17
0
 protected function parseData($data)
 {
     $this->id = intval($data['_attributes']['id']);
     $this->type = $data['_attributes']['type'];
     $this->note_color = intval($data['_attributes']['notecolor']);
     $this->creator_staff_id = ky_assure_positive_int($data['_attributes']['creatorstaffid']);
     $this->creator_staff_name = $data['_attributes']['creatorstaffname'];
     $this->for_staff_id = ky_assure_positive_int($data['_attributes']['forstaffid']);
     $this->creation_date = ky_assure_positive_int($data['_attributes']['creationdate']);
     $this->contents = $data['_contents'];
     if ($this->getType() === kyTicketNote::TYPE_TICKET) {
         $this->ticket_id = ky_assure_positive_int($data['_attributes']['ticketid']);
     } elseif ($this->getType() === kyTicketNote::TYPE_USER) {
         $this->user_id = ky_assure_positive_int($data['_attributes']['userid']);
     } elseif ($this->getType() === kyTicketNote::TYPE_USER_ORGANIZATION) {
         $this->user_organization_id = ky_assure_positive_int($data['_attributes']['userorganizationid']);
     }
 }
 /**
  * Sets the template group identifier.
  * Resets template group name.
  *
  * @param int $template_group_id Template group identifier.
  * @return kyTicket
  */
 public function setTemplateGroupId($template_group_id)
 {
     $this->template_group_id = ky_assure_positive_int($template_group_id);
     $this->template_group_name = null;
     return $this;
 }
 /**
  * Sets the troubleshooterstep Id.
  *
  * @param int $troubleshooterstep_item_id TroubleshooterStep identifier
  *
  * @return $this
  */
 public function setTroubelshooterStepId($troubleshooterstep_item_id)
 {
     $this->troubleshooterstep_item_id = ky_assure_positive_int($troubleshooterstep_item_id);
     $this->troubleshooterstep_item = null;
     return $this;
 }