コード例 #1
0
 /**
  * Creates new attachment for troubleshooterstep with contents read from physical file.
  * WARNING: Data is not sent to Kayako unless you explicitly call create() on this method's result.
  *
  * @param kyTroubleshooterStep $troubleshooter_step troubleshooterstep.
  * @param string $file_path Path to file.
  * @param string $file_name Optional. Use to set filename other than physical file.
  * @return kyTroubleshooterAttachment
  */
 public static function createNewFromFile($troubleshooter_step, $file_path, $file_name = null)
 {
     $new_troubleshooter_attachment = new kyTroubleshooterAttachment();
     $new_troubleshooter_attachment->setTroubleshooterStepId($troubleshooter_step->getId());
     $new_troubleshooter_attachment->setContentsFromFile($file_path, $file_name);
     return $new_troubleshooter_attachment;
 }
コード例 #2
0
 /**
  * Creates a troubleshooterstep item.
  * WARNING: Data is not sent to Kayako unless you explicitly call create() on this method's result.
  *
  * @param string $category Category of troubleshooterstep item.
  * @param string $subject Subject of troubleshooterstep item.
  * @param string $contents Contents of troubleshooterstep item.
  * @param kyStaff $staff Author (staff) of troubleshooterstep item.
  *
  *@return kyTroubleshooterStep
  */
 public static function createNew($category, $subject, $contents, kyStaff $staff)
 {
     $new_troubleshooterstep_item = new kyTroubleshooterStep();
     $new_troubleshooterstep_item->setCategory($category);
     $new_troubleshooterstep_item->setSubject($subject);
     $new_troubleshooterstep_item->setContents($contents);
     $new_troubleshooterstep_item->setStaff($staff);
     return $new_troubleshooterstep_item;
 }
コード例 #3
0
 /**
  * Return troubleshooter item.
  *
  * 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 kyTroubleshooterStep
  */
 public function getTroubleshooterStep($reload = false)
 {
     if ($this->troubleshooterstep_item !== null && !$reload) {
         return $this->troubleshooterstep_item;
     }
     if ($this->troubleshooterstep_item_id === null) {
         return null;
     }
     $this->troubleshooterstep_item = kyTroubleshooterStep::get($this->troubleshooterstep_item_id);
     return $this->troubleshooterstep_item;
 }