コード例 #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;
 }