File tree Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,20 @@ class SDT extends Text
45
45
*/
46
46
private $ listItems = array ();
47
47
48
+ /**
49
+ * Alias
50
+ *
51
+ * @var string
52
+ */
53
+ private $ alias ;
54
+
55
+ /**
56
+ * Tag
57
+ *
58
+ * @var string
59
+ */
60
+ private $ tag ;
61
+
48
62
/**
49
63
* Create new instance
50
64
*
@@ -126,4 +140,36 @@ public function setListItems($value)
126
140
127
141
return $ this ;
128
142
}
143
+
144
+ /**
145
+ * @return string
146
+ */
147
+ public function getTag ()
148
+ {
149
+ return $ this ->tag ;
150
+ }
151
+
152
+ /**
153
+ * @param string $tag
154
+ */
155
+ public function setTag ($ tag )
156
+ {
157
+ $ this ->tag = $ tag ;
158
+ }
159
+
160
+ /**
161
+ * @return mixed
162
+ */
163
+ public function getAlias ()
164
+ {
165
+ return $ this ->alias ;
166
+ }
167
+
168
+ /**
169
+ * @param mixed $alias
170
+ */
171
+ public function setAlias ($ alias )
172
+ {
173
+ $ this ->alias = $ alias ;
174
+ }
129
175
}
Original file line number Diff line number Diff line change @@ -41,13 +41,17 @@ public function write()
41
41
}
42
42
$ type = $ element ->getType ();
43
43
$ writeFormField = "write {$ type }" ;
44
+ $ alias = $ element ->getAlias ();
45
+ $ tag = $ element ->getTag ();
44
46
45
47
$ this ->startElementP ();
46
48
47
49
$ xmlWriter ->startElement ('w:sdt ' );
48
50
49
51
// Properties
50
52
$ xmlWriter ->startElement ('w:sdtPr ' );
53
+ $ xmlWriter ->writeElementBlock ('w:alias ' , 'w:val ' , $ alias );
54
+ $ xmlWriter ->writeElementBlock ('w:tag ' , 'w:val ' , $ tag );
51
55
$ xmlWriter ->writeElementBlock ('w:id ' , 'w:val ' , rand (100000000 , 999999999 ));
52
56
$ xmlWriter ->writeElementBlock ('w:lock ' , 'w:val ' , 'sdtLocked ' );
53
57
$ this ->$ writeFormField ($ xmlWriter , $ element );
You can’t perform that action at this time.
0 commit comments