PluginProbe
wpDataTables – WordPress Data Table, Dynamic Tables & Table Charts Plugin / 6.5.1.7
wpDataTables – WordPress Data Table, Dynamic Tables & Table Charts Plugin v6.5.1.7
6.5.1.7 6.5.1.6 6.5.1.5 6.5.1.4 6.5.1.3 6.5.1.2 6.5.1.1 6.5.0.9 6.5.0.8 6.5.0.7 6.5.0.6 trunk 3.4.2.40 3.4.2.41 3.4.2.42 3.4.2.43 3.4.2.44 3.4.2.45 3.4.2.46 3.4.2.47 3.4.2.48 3.4.2.49 3.4.2.50 6.3.2 6.3.3.1 All 47 releases
wpdatatables / lib / phpoffice / phpspreadsheet / src / PhpSpreadsheet / Chart / Title.php

Title.php in wpDataTables – WordPress Data Table, Dynamic Tables & Table Charts Plugin 6.5.1.7, at lib/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Title.php

116 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace PhpOffice\PhpSpreadsheet\Chart;
4
5 use PhpOffice\PhpSpreadsheet\RichText\RichText;
6
7 class Title
8 {
9 /**
10 * Title Caption.
11 *
12 * @var array|RichText|string
13 */
14 private $caption = '';
15
16 /**
17 * Allow overlay of other elements?
18 *
19 * @var bool
20 */
21 private $overlay = true;
22
23 /**
24 * Title Layout.
25 *
26 * @var ?Layout
27 */
28 private $layout;
29
30 /**
31 * Create a new Title.
32 *
33 * @param array|RichText|string $caption
34 * @param ?Layout $layout
35 * @param bool $overlay
36 */
37 public function __construct($caption = '', ?Layout $layout = null, $overlay = false)
38 {
39 $this->caption = $caption;
40 $this->layout = $layout;
41 $this->setOverlay($overlay);
42 }
43
44 /**
45 * Get caption.
46 *
47 * @return array|RichText|string
48 */
49 public function getCaption()
50 {
51 return $this->caption;
52 }
53
54 public function getCaptionText(): string
55 {
56 $caption = $this->caption;
57 if (is_string($caption)) {
58 return $caption;
59 }
60 if ($caption instanceof RichText) {
61 return $caption->getPlainText();
62 }
63 $retVal = '';
64 foreach ($caption as $textx) {
65 /** @var RichText|string */
66 $text = $textx;
67 if ($text instanceof RichText) {
68 $retVal .= $text->getPlainText();
69 } else {
70 $retVal .= $text;
71 }
72 }
73
74 return $retVal;
75 }
76
77 /**
78 * Set caption.
79 *
80 * @param array|RichText|string $caption
81 *
82 * @return $this
83 */
84 public function setCaption($caption)
85 {
86 $this->caption = $caption;
87
88 return $this;
89 }
90
91 /**
92 * Get allow overlay of other elements?
93 *
94 * @return bool
95 */
96 public function getOverlay()
97 {
98 return $this->overlay;
99 }
100
101 /**
102 * Set allow overlay of other elements?
103 *
104 * @param bool $overlay
105 */
106 public function setOverlay($overlay): void
107 {
108 $this->overlay = $overlay;
109 }
110
111 public function getLayout(): ?Layout
112 {
113 return $this->layout;
114 }
115 }
116