/** * Returns categories of this knowledgebase article. * Result is cached until the end of script. * * @param bool $reload True to reload data from server. False to use the cached value (if present). * @return kyResultSet */ public function getCategories($reload = false) { foreach ($this->category_ids as $category_id) { if (!is_array($this->categories) || !array_key_exists($category_id, $this->categories) || $reload) { $this->categories[$category_id] = kyKnowledgebaseCategory::get($category_id); } } return new kyResultSet(array_values($this->categories)); }
/** * Creates a knowledegbase category. * WARNING: Data is not sent to Kayako unless you explicitly call create() on this method's result. * * @see kyKnowledgebaseCategory::CATEGORY_TYPE constants. * * @param string $title Title of knowledgebase category. * @param int $category_type Category type of knowledgebase item. * @return kyKnowledgebaseCategory */ public static function createNew($title, $category_type) { $new_knowledgebase_category = new kyKnowledgebaseCategory(); $new_knowledgebase_category->setTitle($title); $new_knowledgebase_category->setCategoryType($category_type); return $new_knowledgebase_category; }