WriterPart.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. abstract class PHPExcel_Writer_Excel2007_WriterPart
  8. {
  9. /**
  10. * Parent IWriter object
  11. *
  12. * @var PHPExcel_Writer_IWriter
  13. */
  14. private $parentWriter;
  15. /**
  16. * Set parent IWriter object
  17. *
  18. * @param PHPExcel_Writer_IWriter $pWriter
  19. * @throws PHPExcel_Writer_Exception
  20. */
  21. public function setParentWriter(PHPExcel_Writer_IWriter $pWriter = null)
  22. {
  23. $this->parentWriter = $pWriter;
  24. }
  25. /**
  26. * Get parent IWriter object
  27. *
  28. * @return PHPExcel_Writer_IWriter
  29. * @throws PHPExcel_Writer_Exception
  30. */
  31. public function getParentWriter()
  32. {
  33. if (!is_null($this->parentWriter)) {
  34. return $this->parentWriter;
  35. } else {
  36. throw new PHPExcel_Writer_Exception("No parent PHPExcel_Writer_IWriter assigned.");
  37. }
  38. }
  39. /**
  40. * Set parent IWriter object
  41. *
  42. * @param PHPExcel_Writer_IWriter $pWriter
  43. * @throws PHPExcel_Writer_Exception
  44. */
  45. public function __construct(PHPExcel_Writer_IWriter $pWriter = null)
  46. {
  47. if (!is_null($pWriter)) {
  48. $this->parentWriter = $pWriter;
  49. }
  50. }
  51. }