File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
src/order/orderData/item/component Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ class OneFlowComponent extends OneFlowBase {
1818 */
1919 public function init () {
2020 $ this ->__addProperty ("componentId " );
21+ $ this ->__addProperty ("sourceComponentId " );
2122 $ this ->__addProperty ("type " );
2223 $ this ->__addProperty ("code " );
2324 $ this ->__addProperty ("path " );
@@ -269,6 +270,17 @@ public function setComponentId($componentId) {
269270 $ this ->componentId = $ componentId ;
270271 }
271272
273+ /**
274+ * setSourceComponentId function.
275+ *
276+ * @access public
277+ * @param mixed $sourceComponentId
278+ * @return void
279+ */
280+ public function setSourceComponentId ($ sourceComponentId ) {
281+ $ this ->sourceComponentId = $ sourceComponentId ;
282+ }
283+
272284 /**
273285 * addAttribute function.
274286 *
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ public function testCanBuildASingleItemOrder()
3232 ]);
3333
3434 $ component = $ item ->newComponent ('componentCode ' );
35+ $ component ->setSourceComponentId ('my-source-component-id ' );
3536 $ component ->setFetchUrl ('http://site.com/file.pdf ' );
3637 $ component ->setLocalFile (false );
3738 $ component ->setBarcode ('customComponentBarcode ' );
@@ -151,6 +152,7 @@ public function testCanBuildASingleItemOrder()
151152 $ this ->assertEquals (1 , count ($ outputItem ->components ));
152153 $ outputComponent = $ outputItem ->components [0 ];
153154 $ this ->assertEquals ('componentCode ' , $ outputComponent ->code );
155+ $ this ->assertEquals ('my-source-component-id ' , $ outputComponent ->sourceComponentId );
154156 $ this ->assertEquals ('http://site.com/file.pdf ' , $ outputComponent ->path );
155157 $ this ->assertEquals ('customComponentBarcode ' , $ outputComponent ->barcode );
156158 $ this ->assertEquals (true , $ outputComponent ->fetch );
You can’t perform that action at this time.
0 commit comments