This repository has been archived on 2024-07-11. You can view files and clone it, but cannot push or open issues or pull requests.
yoshop/source/application/common/library/printer/engine/Basics.php

55 lines
1007 B
PHP
Raw Normal View History

2020-04-25 22:20:29 +08:00
<?php
namespace app\common\library\printer\engine;
/**
* 小票打印机驱动基类
* Class Basics
* @package app\common\library\printer\engine
*/
abstract class Basics
{
protected $config; // 打印机配置
protected $times; // 打印联数(次数)
protected $error; // 错误信息
/**
* 构造函数
* Basics constructor.
* @param array $config 打印机配置
* @param int $times 打印联数(次数)
*/
public function __construct($config, $times)
{
$this->config = $config;
$this->times = $times;
}
/**
* 执行打印请求
* @param $content
* @return mixed
*/
abstract protected function printTicket($content);
/**
* 返回错误信息
* @return mixed
*/
public function getError()
{
return $this->error;
}
/**
* 创建打印的内容
* @return string
*/
private function setContentText()
{
return '';
}
}