/** * Sets KnowledgebaseArticle. * * @param kyKnowledgebaseArticle $kbarticle kbarticle item. * @return kyKnowledgebaseComment */ public function setKbarticle($kbarticle) { $this->kbarticle = ky_assure_object($kbarticle, 'kyKnowledgebaseArticle'); $this->kbarticle_id = $this->kbarticle !== null ? $this->kbarticle->getId() : null; return $this; }
/** * Creates a knowledgebase article. * WARNING: Data is not sent to Kayako unless you explicitly call create() on this method's result. * * @param string $subject Subject of knowledgebase article. * @param string $contents Contents of knowledgebase article. * @param kyStaff $staff Author (staff) of knowledgebase article. * @return kyKnowledgebaseCategory */ public static function createNew($subject, $contents, kyStaff $creator_id) { $new_kbarticle_item = new kyKnowledgebaseArticle(); $new_kbarticle_item->setSubject($subject); $new_kbarticle_item->setContents($contents); $new_kbarticle_item->setStaff($creator_id); return $new_kbarticle_item; }
/** * Creates new attachment for kbarticle with contents provided as parameter. * WARNING: Data is not sent to Kayako unless you explicitly call create() on this method's result. * * @param kyKnowledgebaseArticle $kbarticle knowledgebase article. * @param string $contents Raw contents of the file. * @param string $file_name Filename. * @return kyKnowledgebaseAttachment */ public static function createNew($kbarticle, $contents, $file_name) { $new_kbarticle_attachment = new kyKnowledgebaseAttachment(); $new_kbarticle_attachment->setKbarticleId($kbarticle->getId()); $new_kbarticle_attachment->setContents($contents); $new_kbarticle_attachment->setFileName($file_name); return $new_kbarticle_attachment; }