Style.Class.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: phperstar
  5. * Date: 2020/8/11
  6. * Time: 10:28 AM
  7. */
  8. namespace Util\PHPExcel;
  9. class Style
  10. {
  11. /**
  12. * Index of style in collection. Only used for real style.
  13. *
  14. * @var int
  15. */
  16. protected $index;
  17. /**
  18. * Create a new PHPExcel_Style
  19. *
  20. * @param boolean $isSupervisor Flag indicating if this is a supervisor or not
  21. * Leave this value at default unless you understand exactly what
  22. * its ramifications are
  23. * @param boolean $isConditional Flag indicating if this is a conditional style or not
  24. * Leave this value at default unless you understand exactly what
  25. * its ramifications are
  26. */
  27. public function __construct($isSupervisor = false, $isConditional = false)
  28. {
  29. // Supervisor?
  30. $this->isSupervisor = $isSupervisor;
  31. // Initialise values
  32. $this->conditionalStyles = array();
  33. /*$this->font = new PHPExcel_Style_Font($isSupervisor, $isConditional);
  34. $this->fill = new PHPExcel_Style_Fill($isSupervisor, $isConditional);
  35. $this->borders = new PHPExcel_Style_Borders($isSupervisor, $isConditional);
  36. $this->alignment = new PHPExcel_Style_Alignment($isSupervisor, $isConditional);
  37. $this->numberFormat = new PHPExcel_Style_NumberFormat($isSupervisor, $isConditional);
  38. $this->protection = new PHPExcel_Style_Protection($isSupervisor, $isConditional); */
  39. // bind parent if we are a supervisor
  40. if ($isSupervisor) {
  41. $this->font->bindParent($this);
  42. $this->fill->bindParent($this);
  43. $this->borders->bindParent($this);
  44. $this->alignment->bindParent($this);
  45. $this->numberFormat->bindParent($this);
  46. $this->protection->bindParent($this);
  47. }
  48. }
  49. /**
  50. * Set own index in style collection
  51. *
  52. * @param int $pValue
  53. */
  54. public function setIndex($pValue)
  55. {
  56. $this->index = $pValue;
  57. }
  58. }