本文整理汇总了PHP中ky_assure_positive_int函数的典型用法代码示例。如果您正苦于以下问题:PHP ky_assure_positive_int函数的具体用法?PHP ky_assure_positive_int怎么用?PHP ky_assure_positive_int使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ky_assure_positive_int函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parseData
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);
}
示例2: parseData
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']);
}
示例3: setParentCommentId
/**
* 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;
}
示例4: setEditedStaffId
/**
* 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;
}
示例5: setStaffId
/**
* 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;
}
示例6: setCreatorStaffId
/**
* 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;
}
示例7: setKbarticleId
/**
* 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;
}
示例8: setStaffGroupId
/**
* 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;
}
示例9: setTicketPostId
/**
* 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;
}
示例10: parseData
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);
}
}
}
示例11: setNewsItemId
/**
* 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;
}
示例12: setTroubleshooterStepId
/**
* 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;
}
示例13: setStaffId
/**
* 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;
}
示例14: parseData
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);
}
}
}
示例15: setCategoryIds
/**
* 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;
}