BasePrinter.php 940 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace crmeb\basic;
  3. use crmeb\services\printer\AccessToken;
  4. abstract class BasePrinter extends BaseStorage
  5. {
  6. /**
  7. * token句柄
  8. * @var AccessToken
  9. */
  10. protected $accessToken;
  11. /**
  12. * 打印内容
  13. * @var string
  14. */
  15. protected $printerContent;
  16. /**
  17. * BasePrinter constructor.
  18. * @param string $name
  19. * @param AccessToken $accessToken
  20. * @param string $configFile
  21. */
  22. public function __construct(string $name, AccessToken $accessToken, string $configFile)
  23. {
  24. $this->accessToken = $accessToken;
  25. $this->initialize([]);
  26. }
  27. /**
  28. * 开始打印
  29. * @param array|null $systemConfig
  30. * @return mixed
  31. */
  32. abstract public function startPrinter(?array $config = []);
  33. /**
  34. * 设置打印内容
  35. * @param array $config
  36. * @return mixed
  37. */
  38. abstract public function setPrinterContent(array $config);
  39. }