@@ -34,13 +34,44 @@ class TrendLine extends Properties
34
34
/** @var bool */
35
35
private $ dispEq = false ;
36
36
37
+ /** @var string */
38
+ private $ name = '' ;
39
+
40
+ /** @var float */
41
+ private $ backward = 0.0 ;
42
+
43
+ /** @var float */
44
+ private $ forward = 0.0 ;
45
+
46
+ /** @var float */
47
+ private $ intercept = 0.0 ;
48
+
37
49
/**
38
50
* Create a new TrendLine object.
39
51
*/
40
- public function __construct (string $ trendLineType = '' , ?int $ order = null , ?int $ period = null , bool $ dispRSqr = false , bool $ dispEq = false )
41
- {
52
+ public function __construct (
53
+ string $ trendLineType = '' ,
54
+ ?int $ order = null ,
55
+ ?int $ period = null ,
56
+ bool $ dispRSqr = false ,
57
+ bool $ dispEq = false ,
58
+ ?float $ backward = null ,
59
+ ?float $ forward = null ,
60
+ ?float $ intercept = null ,
61
+ ?string $ name = null
62
+ ) {
42
63
parent ::__construct ();
43
- $ this ->setTrendLineProperties ($ trendLineType , $ order , $ period , $ dispRSqr , $ dispEq );
64
+ $ this ->setTrendLineProperties (
65
+ $ trendLineType ,
66
+ $ order ,
67
+ $ period ,
68
+ $ dispRSqr ,
69
+ $ dispEq ,
70
+ $ backward ,
71
+ $ forward ,
72
+ $ intercept ,
73
+ $ name
74
+ );
44
75
}
45
76
46
77
public function getTrendLineType (): string
@@ -103,8 +134,65 @@ public function setDispEq(bool $dispEq): self
103
134
return $ this ;
104
135
}
105
136
106
- public function setTrendLineProperties (? string $ trendLineType = null , ? int $ order = 0 , ? int $ period = 0 , ? bool $ dispRSqr = false , ? bool $ dispEq = false ): self
137
+ public function getName ( ): string
107
138
{
139
+ return $ this ->name ;
140
+ }
141
+
142
+ public function setName (string $ name ): self
143
+ {
144
+ $ this ->name = $ name ;
145
+
146
+ return $ this ;
147
+ }
148
+
149
+ public function getBackward (): float
150
+ {
151
+ return $ this ->backward ;
152
+ }
153
+
154
+ public function setBackward (float $ backward ): self
155
+ {
156
+ $ this ->backward = $ backward ;
157
+
158
+ return $ this ;
159
+ }
160
+
161
+ public function getForward (): float
162
+ {
163
+ return $ this ->forward ;
164
+ }
165
+
166
+ public function setForward (float $ forward ): self
167
+ {
168
+ $ this ->forward = $ forward ;
169
+
170
+ return $ this ;
171
+ }
172
+
173
+ public function getIntercept (): float
174
+ {
175
+ return $ this ->intercept ;
176
+ }
177
+
178
+ public function setIntercept (float $ intercept ): self
179
+ {
180
+ $ this ->intercept = $ intercept ;
181
+
182
+ return $ this ;
183
+ }
184
+
185
+ public function setTrendLineProperties (
186
+ ?string $ trendLineType = null ,
187
+ ?int $ order = 0 ,
188
+ ?int $ period = 0 ,
189
+ ?bool $ dispRSqr = false ,
190
+ ?bool $ dispEq = false ,
191
+ ?float $ backward = null ,
192
+ ?float $ forward = null ,
193
+ ?float $ intercept = null ,
194
+ ?string $ name = null
195
+ ): self {
108
196
if (!empty ($ trendLineType )) {
109
197
$ this ->setTrendLineType ($ trendLineType );
110
198
}
@@ -120,6 +208,18 @@ public function setTrendLineProperties(?string $trendLineType = null, ?int $orde
120
208
if ($ dispEq !== null ) {
121
209
$ this ->setDispEq ($ dispEq );
122
210
}
211
+ if ($ backward !== null ) {
212
+ $ this ->setBackward ($ backward );
213
+ }
214
+ if ($ forward !== null ) {
215
+ $ this ->setForward ($ forward );
216
+ }
217
+ if ($ intercept !== null ) {
218
+ $ this ->setIntercept ($ intercept );
219
+ }
220
+ if ($ name !== null ) {
221
+ $ this ->setName ($ name );
222
+ }
123
223
124
224
return $ this ;
125
225
}
0 commit comments