Closed XeLiatH closed 1 year ago
I like it, but three things please:
isset($data['extId'])
condition to base Document\Header
constructor (it will be used also in Invoice for instance)extId
is already used in Riesenia\Pohoda\Type\Address
as _refElement
- please switch also this one to your implementationit_can_add_extid
?) for this to OrderSpec
Thanks!
and also check tests pls - https://github.com/riesenia/pohoda/runs/7917499582
Thank you for the reply. I will get to it right away.
After giving it quite longer thought than wanted, I went back on my implementation and use the $_refElements
instead.
The difficulty I was having was that the extId
element can have multiple namespaces and I could not figure out how to apply them properly.
For example you have the typ:extId
whenever it is withing typ:address
, but then you can also have ord:extId
or inv:extId
when it is in their respective headers.
I was and actually still am unsure of when to use the $_refElements
and when to use the custom class for defining the type. However, right now with this approach I feel more comfortable, because it works as expected with less code.
Also I did not see any tests for the extId
in Address.php
, so I did not add any either. Let me know if I should.
Sorry if this is too long, just sharing my thought process 😅
I would like to add the
extId
child for orderHeader. Attempted some implementation that I tested locally and that works.Not sure if my attempt is the "proper" way of doing it.
Adding some documentation for reference.
https://www.stormware.cz/schema/version_2/order.xsd
https://www.stormware.cz/schema/version_2/type.xsd