BasePrinter.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace crmeb\basic;
  12. use crmeb\services\printer\AccessToken;
  13. /**
  14. * Class BasePrinter
  15. * @package crmeb\basic
  16. */
  17. abstract class BasePrinter extends BaseStorage
  18. {
  19. /**
  20. * token句柄
  21. * @var AccessToken
  22. */
  23. protected $accessToken;
  24. /**
  25. * 打印内容
  26. * @var string
  27. */
  28. protected $printerContent;
  29. /**
  30. * BasePrinter constructor.
  31. * @param string $name
  32. * @param AccessToken $accessToken
  33. * @param string $configFile
  34. */
  35. public function __construct(string $name, AccessToken $accessToken, string $configFile)
  36. {
  37. parent::__construct($name, [], $configFile);
  38. $this->accessToken = $accessToken;
  39. }
  40. /**
  41. * 开始打印
  42. * @param array|null $systemConfig
  43. * @return mixed
  44. */
  45. abstract public function startPrinter();
  46. /**
  47. * 设置打印内容
  48. * @param array $config
  49. * @return mixed
  50. */
  51. abstract public function setPrinterContent(array $config);
  52. }