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
*
@@ -127,4 +141,36 @@ public function setListItems($value)
127
141
128
142
return $ this ;
129
143
}
144
+
145
+ /**
146
+ * @return string
147
+ */
148
+ public function getTag ()
149
+ {
150
+ return $ this ->tag ;
151
+ }
152
+
153
+ /**
154
+ * @param string $tag
155
+ */
156
+ public function setTag ($ tag )
157
+ {
158
+ $ this ->tag = $ tag ;
159
+ }
160
+
161
+ /**
162
+ * @return mixed
163
+ */
164
+ public function getAlias ()
165
+ {
166
+ return $ this ->alias ;
167
+ }
168
+
169
+ /**
170
+ * @param mixed $alias
171
+ */
172
+ public function setAlias ($ alias )
173
+ {
174
+ $ this ->alias = $ alias ;
175
+ }
130
176
}
Original file line number Diff line number Diff line change @@ -43,13 +43,17 @@ public function write()
43
43
}
44
44
$ type = $ element ->getType ();
45
45
$ writeFormField = "write {$ type }" ;
46
+ $ alias = $ element ->getAlias ();
47
+ $ tag = $ element ->getTag ();
46
48
47
49
$ this ->startElementP ();
48
50
49
51
$ xmlWriter ->startElement ('w:sdt ' );
50
52
51
53
// Properties
52
54
$ xmlWriter ->startElement ('w:sdtPr ' );
55
+ $ xmlWriter ->writeElementBlock ('w:alias ' , 'w:val ' , $ alias );
56
+ $ xmlWriter ->writeElementBlock ('w:tag ' , 'w:val ' , $ tag );
53
57
$ xmlWriter ->writeElementBlock ('w:id ' , 'w:val ' , rand (100000000 , 999999999 ));
54
58
$ xmlWriter ->writeElementBlock ('w:lock ' , 'w:val ' , 'sdtLocked ' );
55
59
$ this ->$ writeFormField ($ xmlWriter , $ element );
You can’t perform that action at this time.
0 commit comments