-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
COHAOR #2
Comments
Yes, it can be done, but I haven't implemented it (I don't use that message). You can write a class similar to the existing ones which outputs the data in the Cohaor message format, take a look to the Iftmbf, or the other container related messages (for example Coparn..) |
They need to be added, because they are implied in the specification. |
What u think so far? I have noticed the *Segment() functions in your Message Class however, i find the functionality limited and created new classses for the segments i need. Test Script:
|
I like your approach, using a class per segment was an idea I had as well but never explored. |
|
I've no strong opinion on the plural vs singular issue, singular could be chosen for uniformity with the existing Interchange / Message (and perhaps an abstract Segment class to act as a template?) but feel free to continue as your best practice works :) |
What u think so far? I moved the segments to a seperate directory. The message content however contains trailing data elements and their leading separators:
I've added a reduce() function in de Message class. |
I did that by checking if the value was set during the compose() run (and similarly in the segment functions), example https://github.com/php-edifact/edifact-generator/blob/master/src/Generator/Coparn.php#L293 and https://github.com/php-edifact/edifact-generator/blob/master/src/Generator/Coparn.php#L240 |
The architecture issue is when using the check on null values is that you must specify each value, Wrong
Good
How you think of this approach ? |
So if one person forgets setTextReference we throw some error? |
In the first approach i set all values 'empty' by default, but then i have trailing data elements and their leading separators. Difficult to throw an Error in the second approach, because you must check, does the value in the segment has previous required values. |
I can't think of a smart way to do it without checking every value... :-/ |
Maybe later, is it possible you merge these changes for now ? |
Done! |
@davidvandertuijn anche user reports this, Fatal error: Declaration of EDI\Generator\Vermas::compose($msgStatus = 5, $documentCode = 749) must be compatible with EDI\Generator\Message::compose(?string $sMessageFunctionCode, ?string $sDocumentNameCode, ?string $sDocumentIdentifier): EDI\Generator\Message in /home/edifact-generator-master/src/Generator/Vermas.php on line 5 |
Does this libary support COHAOR (Container special handling order message) , UN/EDIFACT D17B ?
https://service.unece.org/trade/untdid/d17b/trmd/cohaor_c.htm
The text was updated successfully, but these errors were encountered: