ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ConditionalDataBarExtension.php
Go to the documentation of this file.
1 <?php
2 
4 
6 {
10  private $minLength;
11 
13  private $maxLength;
14 
16  private $border;
17 
19  private $gradient;
20 
22  private $direction;
23 
26 
28  private $axisPosition;
29 
30  // <dataBar> children
31 
34 
37 
39  private $borderColor;
40 
43 
46 
48  private $axisColor = [
49  'rgb' => null,
50  'theme' => null,
51  'tint' => null,
52  ];
53 
54  public function getXmlAttributes()
55  {
56  $ret = [];
57  foreach (['minLength', 'maxLength', 'direction', 'axisPosition'] as $attrKey) {
58  if (null !== $this->{$attrKey}) {
59  $ret[$attrKey] = $this->{$attrKey};
60  }
61  }
62  foreach (['border', 'gradient', 'negativeBarBorderColorSameAsPositive'] as $attrKey) {
63  if (null !== $this->{$attrKey}) {
64  $ret[$attrKey] = $this->{$attrKey} ? '1' : '0';
65  }
66  }
67 
68  return $ret;
69  }
70 
71  public function getXmlElements()
72  {
73  $ret = [];
74  $elms = ['borderColor', 'negativeFillColor', 'negativeBorderColor'];
75  foreach ($elms as $elmKey) {
76  if (null !== $this->{$elmKey}) {
77  $ret[$elmKey] = ['rgb' => $this->{$elmKey}];
78  }
79  }
80  foreach (array_filter($this->axisColor) as $attrKey => $axisColorAttr) {
81  if (!isset($ret['axisColor'])) {
82  $ret['axisColor'] = [];
83  }
84  $ret['axisColor'][$attrKey] = $axisColorAttr;
85  }
86 
87  return $ret;
88  }
89 
93  public function getMinLength()
94  {
95  return $this->minLength;
96  }
97 
98  public function setMinLength(int $minLength): self
99  {
100  $this->minLength = $minLength;
101 
102  return $this;
103  }
104 
108  public function getMaxLength()
109  {
110  return $this->maxLength;
111  }
112 
113  public function setMaxLength(int $maxLength): self
114  {
115  $this->maxLength = $maxLength;
116 
117  return $this;
118  }
119 
123  public function getBorder()
124  {
125  return $this->border;
126  }
127 
128  public function setBorder(bool $border): self
129  {
130  $this->border = $border;
131 
132  return $this;
133  }
134 
138  public function getGradient()
139  {
140  return $this->gradient;
141  }
142 
143  public function setGradient(bool $gradient): self
144  {
145  $this->gradient = $gradient;
146 
147  return $this;
148  }
149 
153  public function getDirection()
154  {
155  return $this->direction;
156  }
157 
158  public function setDirection(string $direction): self
159  {
160  $this->direction = $direction;
161 
162  return $this;
163  }
164 
169  {
171  }
172 
174  {
175  $this->negativeBarBorderColorSameAsPositive = $negativeBarBorderColorSameAsPositive;
176 
177  return $this;
178  }
179 
183  public function getAxisPosition()
184  {
185  return $this->axisPosition;
186  }
187 
188  public function setAxisPosition(string $axisPosition): self
189  {
190  $this->axisPosition = $axisPosition;
191 
192  return $this;
193  }
194 
199  {
201  }
202 
204  {
205  $this->maximumConditionalFormatValueObject = $maximumConditionalFormatValueObject;
206 
207  return $this;
208  }
209 
214  {
216  }
217 
219  {
220  $this->minimumConditionalFormatValueObject = $minimumConditionalFormatValueObject;
221 
222  return $this;
223  }
224 
228  public function getBorderColor()
229  {
230  return $this->borderColor;
231  }
232 
233  public function setBorderColor(string $borderColor): self
234  {
235  $this->borderColor = $borderColor;
236 
237  return $this;
238  }
239 
243  public function getNegativeFillColor()
244  {
246  }
247 
248  public function setNegativeFillColor(string $negativeFillColor): self
249  {
250  $this->negativeFillColor = $negativeFillColor;
251 
252  return $this;
253  }
254 
258  public function getNegativeBorderColor()
259  {
261  }
262 
263  public function setNegativeBorderColor(string $negativeBorderColor): self
264  {
265  $this->negativeBorderColor = $negativeBorderColor;
266 
267  return $this;
268  }
269 
270  public function getAxisColor(): array
271  {
272  return $this->axisColor;
273  }
274 
280  public function setAxisColor($rgb, $theme = null, $tint = null): self
281  {
282  $this->axisColor = [
283  'rgb' => $rgb,
284  'theme' => $theme,
285  'tint' => $tint,
286  ];
287 
288  return $this;
289  }
290 }
setMinimumConditionalFormatValueObject(ConditionalFormatValueObject $minimumConditionalFormatValueObject)
$ret
Definition: parser.php:6
setMaximumConditionalFormatValueObject(ConditionalFormatValueObject $maximumConditionalFormatValueObject)