EDIFACTWriter Class
Properties Methods Events Config Settings Errors
The EDIFACTWriter class generates EDIFACT documents with a clear, straightforward API.
Class Name
EDISDK_EDIFACTWriter
Procedural Interface
edisdk_edifactwriter_open(); edisdk_edifactwriter_close($res); edisdk_edifactwriter_register_callback($res, $id, $function); edisdk_edifactwriter_get_last_error($res); edisdk_edifactwriter_get_last_error_code($res); edisdk_edifactwriter_set($res, $id, $index, $value); edisdk_edifactwriter_get($res, $id, $index); edisdk_edifactwriter_do_close($res); edisdk_edifactwriter_do_config($res, $configurationstring); edisdk_edifactwriter_do_endcompositeelement($res); edisdk_edifactwriter_do_endfunctionalgroup($res); edisdk_edifactwriter_do_endinterchange($res); edisdk_edifactwriter_do_endmessage($res); edisdk_edifactwriter_do_endsegment($res); edisdk_edifactwriter_do_reset($res); edisdk_edifactwriter_do_startcompositeelement($res); edisdk_edifactwriter_do_startfunctionalgroup($res); edisdk_edifactwriter_do_startinterchange($res); edisdk_edifactwriter_do_startmessage($res); edisdk_edifactwriter_do_startsegment($res, $tag); edisdk_edifactwriter_do_writecomponent($res, $val); edisdk_edifactwriter_do_writeelement($res, $val);
Remarks
The class allows you to create an EDI document from scratch, one segment at a time. Here's how a document would normally be created:
- Call LoadSchema to load the necessary schemas for the transactions that will be used.
- Specify where to write the output document by setting the OutputFile, or check the OutputData property after writing.
- Create a new interchange start segment by setting the fields of the Interchange property and call the StartInterchange method. Once the interchange is complete, call EndInterchange to add the interchange footer.
- If you want to create a functional group, set the fields of the FunctionalGroup property and then call the StartFunctionalGroup. Once all the messages in the group have been created, call EndFunctionalGroup to add a footer for the group.
- To start a message, call the StartMessage method. Once all segments have been added, call EndMessage to add a footer to the message.
- To begin a segment, call the StartSegment method and pass in the tag for the segment. Once all the elements in the segment have been added, call EndSegment to add the segment terminator.
- To write a basic element to the current segment, call the WriteElement method.
- To write a composite element, call the StartCompositeElement method, then call the WriteComponent method for each component, and finally call EndCompositeElement to end the element.
Property List
The following is the full list of the properties of the class with short descriptions. Click on the links for further details.
| DelimiterComponent | The character used to separate the classes in a composite element. |
| DelimiterDecimal | The character used to separate the integer portion of a numeric value from the fractional portion. |
| DelimiterElement | The delimiter used to separate elements within a segment. |
| DelimiterRelease | The character used to escape other characters within a property. |
| DelimiterRepetition | The character used to indicate a repeating element or class. |
| DelimiterSegment | The character used to terminate a segment. |
| FileWriteMode | Determines how the output file is opened for writing. |
| FGroupAppPassword | The application password as specified in the functional group header. |
| FGroupAppRecipientIdentification | The name or code of the intended recipient of the message group. |
| FGroupAppRecipientIDQualifier | The qualifier for the recipient's identification (if it contains a code value). |
| FGroupAppSenderIdentification | The name or code of the message group's sender. |
| FGroupAppSenderIDQualifier | The qualifier for the sender's identification (if it contains a code value). |
| FGroupAssociationAssignedCode | The assigned code for the message type. |
| FGroupControllingAgency | A code value that indicates the agency responsible for maintaining the message specifications. |
| FGroupDate | The date that the group of messages was prepared. |
| FGroupGroupIdentification | The identification value for the functional group. |
| FGroupMessageRelease | The message release number for the message type appearing in the message group. |
| FGroupMessageVersion | The message version number for message type appearing in the functional group. |
| FGroupReferenceNumber | The reference number for the functional group. |
| FGroupTime | The time that the group of messages was prepared. |
| InterchangeAckRequest | If this property is '1', an ACK was requested in response to this interchange. |
| InterchangeAgreementIdentifier | The identifier for the communication agreement used by the interchange. |
| InterchangeApplicationReference | If the interchange contains only one type of message, this can contain the identifier for the type of message. |
| InterchangeCharacterEncoding | The character encoding used by the interchange. |
| InterchangeCodeListVersionNumber | The identifier for the communication agreement used by the interchange. |
| InterchangeDate | The date that the interchange was prepared. |
| InterchangeProcessingPriorityCode | A 1-character code that requests a specific processing priority for the interchange. |
| InterchangeRecipientIdentification | The identification for the interchange's recipient. |
| InterchangeRecipientIDQualifier | The qualifier for the recipient identification code. |
| InterchangeRecipientInternalIdentification | More specific recipient identification for internal use. |
| InterchangeRecipientInternalSubIdentification | A sub-identification string for the receiver for internal use. |
| InterchangeRecipientPassword | A password to be verified by the recipient, such as a system or network password. |
| InterchangeRecipientPasswordQualifier | A qualifier for the recipient password. |
| InterchangeReferenceNumber | A reference number for the interchange. |
| InterchangeSenderIdentification | The identification for the interchange's sender. |
| InterchangeSenderIDQualifier | The qualifier for the sender identification code. |
| InterchangeSenderInternalIdentification | More specific sender identification for internal use. |
| InterchangeSenderInternalSubIdentification | A sub-identification string for the sender for internal use. |
| InterchangeSyntaxIdentifier | A identifier specifying the controlling agency and valid character set. |
| InterchangeSyntaxVersionNumber | A 1-character numeric value indicating the syntax version. |
| InterchangeTestIndicator | If this property is '1', the interchange is a test interchange. |
| InterchangeTime | The time that the interchange was prepared. |
| MsgAssociationAssignedCode | A code assigned to the message by the controlling organization. |
| MsgCodeListVersionNumber | The version number of the code list that should be used. |
| MsgCommonAccessReference | A reference value to associate this message with related messages. |
| MsgControllingAgency | A code that identifies the controlling agency for this message type. |
| MsgFirstAndLastTransfer | A single-character property that indicates the first and last messages in a related set. |
| MsgMessageImplControllingAgency | A code value that identifies the controlling agency for the message implementation. |
| MsgMessageImplIdentification | Identifies the message implementation. |
| MsgMessageImplRelease | Identifies the release number for the message implementation. |
| MsgMessageImplVersion | Identifies the version number for the message implementation. |
| MsgMessageRelease | Identifies the release number for the message. |
| MsgMessageSubsetControllingAgency | A code value that identifies the controlling agency for the message subset. |
| MsgMessageSubsetIdentification | Identifies the message subset. |
| MsgMessageSubsetRelease | Identifies the release number for the message subset. |
| MsgMessageSubsetVersion | Identifies the version number for the message subset. |
| MsgMessageType | A code identifying the message's type. |
| MsgMessageTypeSubFunctionIdentification | A code identifying the sub-function of the message's type. |
| MsgMessageVersion | Identifies the version number for the message. |
| MsgReferenceNumber | A unique reference number for the message. |
| MsgScenarioControllingAgency | Identifies the controlling agency for the message scenario. |
| MsgScenarioIdentification | The identifier for the message scenario. |
| MsgScenarioRelease | The message scenario's release number. |
| MsgScenarioVersion | The message scenario's version number. |
| MsgSequenceOfTransfers | Specifies the message's position in a sequence. |
| OutputData | The output data that has been written so far. |
| OutputFile | The name of the output file to which the EDI data will be written. |
| SegmentSuffix | The suffix that is appended to the end of a segment. |
Method List
The following is the full list of the methods of the class with short descriptions. Click on the links for further details.
| Close | Closes the writer. |
| Config | Sets or retrieves a configuration setting. |
| EndCompositeElement | Finish writing the composite element. |
| EndFunctionalGroup | Write the UNE(FunctionalGroup) segment to the output file/data/stream. |
| EndInterchange | Write the UNZ(Interchange) segment to the output file/data/stream. |
| EndMessage | Closes the current message. |
| EndSegment | Finish writing the segment, add SegmentSuffix at the end of the segment. |
| Reset | Resets all properties to their default values. |
| StartCompositeElement | Starts a composite element within the current segment. |
| StartFunctionalGroup | Starts a new functional group in the EDI document. |
| StartInterchange | Starts a new interchange in the EDI document. |
| StartMessage | Starts a new message in the EDI document. |
| StartSegment | Starts a new segment with the specified tag. |
| WriteComponent | Writes a class element value to the current composite element. |
| WriteElement | Writes an element value to the current segment. |
Event List
The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.
| Error | Fires when an error occurs during message processing. Normally, the class fails with an error. |
| Output | Fires when output data is written. |
Config Settings
The following is a list of config settings for the class with short descriptions. Click on the links for further details.
DelimiterComponent Property (EDISDK_EDIFACTWriter Class)
The character used to separate the classes in a composite element.
Object Oriented Interface
public function getDelimiterComponent(); public function setDelimiterComponent($value);
Procedural Interface
edisdk_edifactwriter_get($res, 1 ); edisdk_edifactwriter_set($res, 1, $value );
Default Value
':'
Remarks
The character used to separate the components in a composite element.
This property is not available at design time.
Data Type
String
DelimiterDecimal Property (EDISDK_EDIFACTWriter Class)
The character used to separate the integer portion of a numeric value from the fractional portion.
Object Oriented Interface
public function getDelimiterDecimal(); public function setDelimiterDecimal($value);
Procedural Interface
edisdk_edifactwriter_get($res, 2 ); edisdk_edifactwriter_set($res, 2, $value );
Default Value
'.'
Remarks
The character used to separate the integer portion of a numeric value from the fractional portion.
This property is not available at design time.
Data Type
String
DelimiterElement Property (EDISDK_EDIFACTWriter Class)
The delimiter used to separate elements within a segment.
Object Oriented Interface
public function getDelimiterElement(); public function setDelimiterElement($value);
Procedural Interface
edisdk_edifactwriter_get($res, 3 ); edisdk_edifactwriter_set($res, 3, $value );
Default Value
'+'
Remarks
The delimiter used to separate elements within a segment.
This property is not available at design time.
Data Type
String
DelimiterRelease Property (EDISDK_EDIFACTWriter Class)
The character used to escape other characters within a property.
Object Oriented Interface
public function getDelimiterRelease(); public function setDelimiterRelease($value);
Procedural Interface
edisdk_edifactwriter_get($res, 4 ); edisdk_edifactwriter_set($res, 4, $value );
Default Value
'?'
Remarks
The character used to escape other characters within a field. For example, with the default EDIFACT delimiters, "?+" should be considered "+" character that appears within a field, not an element separator.
This property is not available at design time.
Data Type
String
DelimiterRepetition Property (EDISDK_EDIFACTWriter Class)
The character used to indicate a repeating element or class.
Object Oriented Interface
public function getDelimiterRepetition(); public function setDelimiterRepetition($value);
Procedural Interface
edisdk_edifactwriter_get($res, 5 ); edisdk_edifactwriter_set($res, 5, $value );
Default Value
'*(syntax 4) or empty(syntax 3)'
Remarks
The character used to indicate a repeating element or component.
This property is not available at design time.
Data Type
String
DelimiterSegment Property (EDISDK_EDIFACTWriter Class)
The character used to terminate a segment.
Object Oriented Interface
public function getDelimiterSegment(); public function setDelimiterSegment($value);
Procedural Interface
edisdk_edifactwriter_get($res, 6 ); edisdk_edifactwriter_set($res, 6, $value );
Default Value
'''
Remarks
The character used to terminate a segment.
This property is not available at design time.
Data Type
String
FileWriteMode Property (EDISDK_EDIFACTWriter Class)
Determines how the output file is opened for writing.
Object Oriented Interface
public function getFileWriteMode(); public function setFileWriteMode($value);
Procedural Interface
edisdk_edifactwriter_get($res, 7 ); edisdk_edifactwriter_set($res, 7, $value );
Possible Values
EDIFACTWRITER_FILEWRITEMODE_CREATE(0),
EDIFACTWRITER_FILEWRITEMODE_OVERWRITE(1),
EDIFACTWRITER_FILEWRITEMODE_APPEND(2)
Default Value
0
Remarks
When OutputFile is set, this property determines how the file will be opened.
| fwmCreate (Default) | Creates a new file. If the file already exists, the translation will fail. |
| fwmOverwrite | Opens an existing file and overwrites its contents. If the file does not exist, a new file will be created. |
| fwmAppend | Opens an existing file and appends data to the end of the file. If the file does not exist, a new file will be created. |
This property is not available at design time.
Data Type
Integer
FGroupAppPassword Property (EDISDK_EDIFACTWriter Class)
The application password as specified in the functional group header.
Object Oriented Interface
public function getFGroupAppPassword(); public function setFGroupAppPassword($value);
Procedural Interface
edisdk_edifactwriter_get($res, 8 ); edisdk_edifactwriter_set($res, 8, $value );
Default Value
''
Remarks
The application password as specified in the functional group header.
This is an alphanumeric field with a value up to 14 characters long.
This property is not available at design time.
Data Type
String
FGroupAppRecipientIdentification Property (EDISDK_EDIFACTWriter Class)
The name or code of the intended recipient of the message group.
Object Oriented Interface
public function getFGroupAppRecipientIdentification(); public function setFGroupAppRecipientIdentification($value);
Procedural Interface
edisdk_edifactwriter_get($res, 9 ); edisdk_edifactwriter_set($res, 9, $value );
Default Value
''
Remarks
The name or code of the intended recipient of the message group.
This is an alphanumeric field with a value up to 35 characters long.
This property is not available at design time.
Data Type
String
FGroupAppRecipientIDQualifier Property (EDISDK_EDIFACTWriter Class)
The qualifier for the recipient's identification (if it contains a code value).
Object Oriented Interface
public function getFGroupAppRecipientIDQualifier(); public function setFGroupAppRecipientIDQualifier($value);
Procedural Interface
edisdk_edifactwriter_get($res, 10 ); edisdk_edifactwriter_set($res, 10, $value );
Default Value
''
Remarks
The qualifier for the recipient's identification (if it contains a code value).
This is an alphanumeric field with a value up to 4 characters long.
This property is not available at design time.
Data Type
String
FGroupAppSenderIdentification Property (EDISDK_EDIFACTWriter Class)
The name or code of the message group's sender.
Object Oriented Interface
public function getFGroupAppSenderIdentification(); public function setFGroupAppSenderIdentification($value);
Procedural Interface
edisdk_edifactwriter_get($res, 11 ); edisdk_edifactwriter_set($res, 11, $value );
Default Value
''
Remarks
The name or code of the message group's sender.
This is an alphanumeric field with a value up to 35 characters long.
This property is not available at design time.
Data Type
String
FGroupAppSenderIDQualifier Property (EDISDK_EDIFACTWriter Class)
The qualifier for the sender's identification (if it contains a code value).
Object Oriented Interface
public function getFGroupAppSenderIDQualifier(); public function setFGroupAppSenderIDQualifier($value);
Procedural Interface
edisdk_edifactwriter_get($res, 12 ); edisdk_edifactwriter_set($res, 12, $value );
Default Value
''
Remarks
The qualifier for the sender's identification (if it contains a code value).
This is an alphanumeric field with a value up to 4 characters long.
This property is not available at design time.
Data Type
String
FGroupAssociationAssignedCode Property (EDISDK_EDIFACTWriter Class)
The assigned code for the message type.
Object Oriented Interface
public function getFGroupAssociationAssignedCode(); public function setFGroupAssociationAssignedCode($value);
Procedural Interface
edisdk_edifactwriter_get($res, 13 ); edisdk_edifactwriter_set($res, 13, $value );
Default Value
''
Remarks
The assigned code for the message type.
This is an alphanumeric field with a value up to 6 characters long.
This property is not available at design time.
Data Type
String
FGroupControllingAgency Property (EDISDK_EDIFACTWriter Class)
A code value that indicates the agency responsible for maintaining the message specifications.
Object Oriented Interface
public function getFGroupControllingAgency(); public function setFGroupControllingAgency($value);
Procedural Interface
edisdk_edifactwriter_get($res, 14 ); edisdk_edifactwriter_set($res, 14, $value );
Default Value
''
Remarks
A code value that indicates the agency responsible for maintaining the message specifications.
This is an alphanumeric field with a value up to 3 characters long.
This property is not available at design time.
Data Type
String
FGroupDate Property (EDISDK_EDIFACTWriter Class)
The date that the group of messages was prepared.
Object Oriented Interface
public function getFGroupDate(); public function setFGroupDate($value);
Procedural Interface
edisdk_edifactwriter_get($res, 15 ); edisdk_edifactwriter_set($res, 15, $value );
Default Value
''
Remarks
The date that the group of messages was prepared.
This property is not available at design time.
Data Type
String
FGroupGroupIdentification Property (EDISDK_EDIFACTWriter Class)
The identification value for the functional group.
Object Oriented Interface
public function getFGroupGroupIdentification(); public function setFGroupGroupIdentification($value);
Procedural Interface
edisdk_edifactwriter_get($res, 16 ); edisdk_edifactwriter_set($res, 16, $value );
Default Value
''
Remarks
The identification value for the functional group.
This is an alphanumeric field with a value up to 6 characters long.
This property is not available at design time.
Data Type
String
FGroupMessageRelease Property (EDISDK_EDIFACTWriter Class)
The message release number for the message type appearing in the message group.
Object Oriented Interface
public function getFGroupMessageRelease(); public function setFGroupMessageRelease($value);
Procedural Interface
edisdk_edifactwriter_get($res, 17 ); edisdk_edifactwriter_set($res, 17, $value );
Default Value
''
Remarks
The message release number for the message type appearing in the message group.
This is an alphanumeric field with a value up to 3 characters long.
This property is not available at design time.
Data Type
String
FGroupMessageVersion Property (EDISDK_EDIFACTWriter Class)
The message version number for message type appearing in the functional group.
Object Oriented Interface
public function getFGroupMessageVersion(); public function setFGroupMessageVersion($value);
Procedural Interface
edisdk_edifactwriter_get($res, 18 ); edisdk_edifactwriter_set($res, 18, $value );
Default Value
''
Remarks
The message version number for message type appearing in the functional group.
This is an alphanumeric field with a value up to 3 characters long.
This property is not available at design time.
Data Type
String
FGroupReferenceNumber Property (EDISDK_EDIFACTWriter Class)
The reference number for the functional group.
Object Oriented Interface
public function getFGroupReferenceNumber(); public function setFGroupReferenceNumber($value);
Procedural Interface
edisdk_edifactwriter_get($res, 19 ); edisdk_edifactwriter_set($res, 19, $value );
Default Value
''
Remarks
The reference number for the functional group.
This is an alphanumeric field with a value up to 14 characters long.
This property is not available at design time.
Data Type
String
FGroupTime Property (EDISDK_EDIFACTWriter Class)
The time that the group of messages was prepared.
Object Oriented Interface
public function getFGroupTime(); public function setFGroupTime($value);
Procedural Interface
edisdk_edifactwriter_get($res, 20 ); edisdk_edifactwriter_set($res, 20, $value );
Default Value
''
Remarks
The time that the group of messages was prepared.
This property is not available at design time.
Data Type
String
InterchangeAckRequest Property (EDISDK_EDIFACTWriter Class)
If this property is '1', an ACK was requested in response to this interchange.
Object Oriented Interface
public function getInterchangeAckRequest(); public function setInterchangeAckRequest($value);
Procedural Interface
edisdk_edifactwriter_get($res, 21 ); edisdk_edifactwriter_set($res, 21, $value );
Default Value
''
Remarks
If this field is '1', an ACK was requested in response to this interchange.
This property is not available at design time.
Data Type
String
InterchangeAgreementIdentifier Property (EDISDK_EDIFACTWriter Class)
The identifier for the communication agreement used by the interchange.
Object Oriented Interface
public function getInterchangeAgreementIdentifier(); public function setInterchangeAgreementIdentifier($value);
Procedural Interface
edisdk_edifactwriter_get($res, 22 ); edisdk_edifactwriter_set($res, 22, $value );
Default Value
''
Remarks
The identifier for the communication agreement used by the interchange.
This is an alphanumeric field with a value up to 35 characters long.
This property is not available at design time.
Data Type
String
InterchangeApplicationReference Property (EDISDK_EDIFACTWriter Class)
If the interchange contains only one type of message, this can contain the identifier for the type of message.
Object Oriented Interface
public function getInterchangeApplicationReference(); public function setInterchangeApplicationReference($value);
Procedural Interface
edisdk_edifactwriter_get($res, 23 ); edisdk_edifactwriter_set($res, 23, $value );
Default Value
''
Remarks
If the interchange contains only one type of message, this can contain the identifier for the type of message.
This is an alphanumeric field with a value up to 14 characters long.
This property is not available at design time.
Data Type
String
InterchangeCharacterEncoding Property (EDISDK_EDIFACTWriter Class)
The character encoding used by the interchange.
Object Oriented Interface
public function getInterchangeCharacterEncoding(); public function setInterchangeCharacterEncoding($value);
Procedural Interface
edisdk_edifactwriter_get($res, 24 ); edisdk_edifactwriter_set($res, 24, $value );
Default Value
''
Remarks
The character encoding used by the interchange.
This is an alphanumeric field with a value up to 3 characters long, and is only present for EDIFACT syntax 4.
This property is not available at design time.
Data Type
String
InterchangeCodeListVersionNumber Property (EDISDK_EDIFACTWriter Class)
The identifier for the communication agreement used by the interchange.
Object Oriented Interface
public function getInterchangeCodeListVersionNumber(); public function setInterchangeCodeListVersionNumber($value);
Procedural Interface
edisdk_edifactwriter_get($res, 25 ); edisdk_edifactwriter_set($res, 25, $value );
Default Value
''
Remarks
The identifier for the communication agreement used by the interchange.
This is an alphanumeric field with a value up to 6 characters long.
This property is not available at design time.
Data Type
String
InterchangeDate Property (EDISDK_EDIFACTWriter Class)
The date that the interchange was prepared.
Object Oriented Interface
public function getInterchangeDate(); public function setInterchangeDate($value);
Procedural Interface
edisdk_edifactwriter_get($res, 26 ); edisdk_edifactwriter_set($res, 26, $value );
Default Value
''
Remarks
The date that the interchange was prepared.
This property is not available at design time.
Data Type
String
InterchangeProcessingPriorityCode Property (EDISDK_EDIFACTWriter Class)
A 1-character code that requests a specific processing priority for the interchange.
Object Oriented Interface
public function getInterchangeProcessingPriorityCode(); public function setInterchangeProcessingPriorityCode($value);
Procedural Interface
edisdk_edifactwriter_get($res, 27 ); edisdk_edifactwriter_set($res, 27, $value );
Default Value
''
Remarks
A 1-character code that requests a specific processing priority for the interchange.
This property is not available at design time.
Data Type
String
InterchangeRecipientIdentification Property (EDISDK_EDIFACTWriter Class)
The identification for the interchange's recipient.
Object Oriented Interface
public function getInterchangeRecipientIdentification(); public function setInterchangeRecipientIdentification($value);
Procedural Interface
edisdk_edifactwriter_get($res, 28 ); edisdk_edifactwriter_set($res, 28, $value );
Default Value
''
Remarks
The identification for the interchange's recipient.
This is an alphanumeric field with a value up to 35 characters long.
This property is not available at design time.
Data Type
String
InterchangeRecipientIDQualifier Property (EDISDK_EDIFACTWriter Class)
The qualifier for the recipient identification code.
Object Oriented Interface
public function getInterchangeRecipientIDQualifier(); public function setInterchangeRecipientIDQualifier($value);
Procedural Interface
edisdk_edifactwriter_get($res, 29 ); edisdk_edifactwriter_set($res, 29, $value );
Default Value
''
Remarks
The qualifier for the recipient identification code.
This is an alphanumeric field with a value up to 4 characters long.
This property is not available at design time.
Data Type
String
InterchangeRecipientInternalIdentification Property (EDISDK_EDIFACTWriter Class)
More specific recipient identification for internal use.
Object Oriented Interface
public function getInterchangeRecipientInternalIdentification(); public function setInterchangeRecipientInternalIdentification($value);
Procedural Interface
edisdk_edifactwriter_get($res, 30 ); edisdk_edifactwriter_set($res, 30, $value );
Default Value
''
Remarks
More specific recipient identification for internal use.
This is an alphanumeric field with a value up to 35 characters long.
This property is not available at design time.
Data Type
String
InterchangeRecipientInternalSubIdentification Property (EDISDK_EDIFACTWriter Class)
A sub-identification string for the receiver for internal use.
Object Oriented Interface
public function getInterchangeRecipientInternalSubIdentification(); public function setInterchangeRecipientInternalSubIdentification($value);
Procedural Interface
edisdk_edifactwriter_get($res, 31 ); edisdk_edifactwriter_set($res, 31, $value );
Default Value
''
Remarks
A sub-identification string for the receiver for internal use.
This is an alphanumeric field with a value up to 35 characters long.
This property is not available at design time.
Data Type
String
InterchangeRecipientPassword Property (EDISDK_EDIFACTWriter Class)
A password to be verified by the recipient, such as a system or network password.
Object Oriented Interface
public function getInterchangeRecipientPassword(); public function setInterchangeRecipientPassword($value);
Procedural Interface
edisdk_edifactwriter_get($res, 32 ); edisdk_edifactwriter_set($res, 32, $value );
Default Value
''
Remarks
A password to be verified by the recipient, such as a system or network password.
This is an alphanumeric field with a value up to 14 characters long.
This property is not available at design time.
Data Type
String
InterchangeRecipientPasswordQualifier Property (EDISDK_EDIFACTWriter Class)
A qualifier for the recipient password.
Object Oriented Interface
public function getInterchangeRecipientPasswordQualifier(); public function setInterchangeRecipientPasswordQualifier($value);
Procedural Interface
edisdk_edifactwriter_get($res, 33 ); edisdk_edifactwriter_set($res, 33, $value );
Default Value
''
Remarks
A qualifier for the recipient password.
This is an alphanumeric field with a value up to 2 characters long.
This property is not available at design time.
Data Type
String
InterchangeReferenceNumber Property (EDISDK_EDIFACTWriter Class)
A reference number for the interchange.
Object Oriented Interface
public function getInterchangeReferenceNumber(); public function setInterchangeReferenceNumber($value);
Procedural Interface
edisdk_edifactwriter_get($res, 34 ); edisdk_edifactwriter_set($res, 34, $value );
Default Value
''
Remarks
A reference number for the interchange.
This is an alphanumeric field with a value up to 14 characters long.
This property is not available at design time.
Data Type
String
InterchangeSenderIdentification Property (EDISDK_EDIFACTWriter Class)
The identification for the interchange's sender.
Object Oriented Interface
public function getInterchangeSenderIdentification(); public function setInterchangeSenderIdentification($value);
Procedural Interface
edisdk_edifactwriter_get($res, 35 ); edisdk_edifactwriter_set($res, 35, $value );
Default Value
''
Remarks
The identification for the interchange's sender.
This is an alphanumeric field with a value up to 35 characters long.
This property is not available at design time.
Data Type
String
InterchangeSenderIDQualifier Property (EDISDK_EDIFACTWriter Class)
The qualifier for the sender identification code.
Object Oriented Interface
public function getInterchangeSenderIDQualifier(); public function setInterchangeSenderIDQualifier($value);
Procedural Interface
edisdk_edifactwriter_get($res, 36 ); edisdk_edifactwriter_set($res, 36, $value );
Default Value
''
Remarks
The qualifier for the sender identification code.
This is an alphanumeric field with a value up to 4 characters long.
This property is not available at design time.
Data Type
String
InterchangeSenderInternalIdentification Property (EDISDK_EDIFACTWriter Class)
More specific sender identification for internal use.
Object Oriented Interface
public function getInterchangeSenderInternalIdentification(); public function setInterchangeSenderInternalIdentification($value);
Procedural Interface
edisdk_edifactwriter_get($res, 37 ); edisdk_edifactwriter_set($res, 37, $value );
Default Value
''
Remarks
More specific sender identification for internal use.
This is an alphanumeric field with a value up to 35 characters long.
This property is not available at design time.
Data Type
String
InterchangeSenderInternalSubIdentification Property (EDISDK_EDIFACTWriter Class)
A sub-identification string for the sender for internal use.
Object Oriented Interface
public function getInterchangeSenderInternalSubIdentification(); public function setInterchangeSenderInternalSubIdentification($value);
Procedural Interface
edisdk_edifactwriter_get($res, 38 ); edisdk_edifactwriter_set($res, 38, $value );
Default Value
''
Remarks
A sub-identification string for the sender for internal use.
This is an alphanumeric field with a value up to 35 characters long.
This property is not available at design time.
Data Type
String
InterchangeSyntaxIdentifier Property (EDISDK_EDIFACTWriter Class)
A identifier specifying the controlling agency and valid character set.
Object Oriented Interface
public function getInterchangeSyntaxIdentifier(); public function setInterchangeSyntaxIdentifier($value);
Procedural Interface
edisdk_edifactwriter_get($res, 39 ); edisdk_edifactwriter_set($res, 39, $value );
Default Value
''
Remarks
A identifier specifying the controlling agency and valid character set.
This is an alphanumeric field with a value up to 4 characters long.
This property is not available at design time.
Data Type
String
InterchangeSyntaxVersionNumber Property (EDISDK_EDIFACTWriter Class)
A 1-character numeric value indicating the syntax version.
Object Oriented Interface
public function getInterchangeSyntaxVersionNumber(); public function setInterchangeSyntaxVersionNumber($value);
Procedural Interface
edisdk_edifactwriter_get($res, 40 ); edisdk_edifactwriter_set($res, 40, $value );
Default Value
''
Remarks
A 1-character numeric value indicating the syntax version.
This property is not available at design time.
Data Type
String
InterchangeTestIndicator Property (EDISDK_EDIFACTWriter Class)
If this property is '1', the interchange is a test interchange.
Object Oriented Interface
public function getInterchangeTestIndicator(); public function setInterchangeTestIndicator($value);
Procedural Interface
edisdk_edifactwriter_get($res, 41 ); edisdk_edifactwriter_set($res, 41, $value );
Default Value
''
Remarks
If this field is '1', the interchange is a test interchange.
This property is not available at design time.
Data Type
String
InterchangeTime Property (EDISDK_EDIFACTWriter Class)
The time that the interchange was prepared.
Object Oriented Interface
public function getInterchangeTime(); public function setInterchangeTime($value);
Procedural Interface
edisdk_edifactwriter_get($res, 42 ); edisdk_edifactwriter_set($res, 42, $value );
Default Value
''
Remarks
The time that the interchange was prepared.
This property is not available at design time.
Data Type
String
MsgAssociationAssignedCode Property (EDISDK_EDIFACTWriter Class)
A code assigned to the message by the controlling organization.
Object Oriented Interface
public function getMsgAssociationAssignedCode(); public function setMsgAssociationAssignedCode($value);
Procedural Interface
edisdk_edifactwriter_get($res, 43 ); edisdk_edifactwriter_set($res, 43, $value );
Default Value
''
Remarks
A code assigned to the message by the controlling organization.
This is an alphanumeric field with a value up to 6 characters long.
This property is not available at design time.
Data Type
String
MsgCodeListVersionNumber Property (EDISDK_EDIFACTWriter Class)
The version number of the code list that should be used.
Object Oriented Interface
public function getMsgCodeListVersionNumber(); public function setMsgCodeListVersionNumber($value);
Procedural Interface
edisdk_edifactwriter_get($res, 44 ); edisdk_edifactwriter_set($res, 44, $value );
Default Value
''
Remarks
The version number of the code list that should be used.
This is an alphanumeric field with a value up to 6 characters long. This field only appears in EDIFACT syntax version 4.
This property is not available at design time.
Data Type
String
MsgCommonAccessReference Property (EDISDK_EDIFACTWriter Class)
A reference value to associate this message with related messages.
Object Oriented Interface
public function getMsgCommonAccessReference(); public function setMsgCommonAccessReference($value);
Procedural Interface
edisdk_edifactwriter_get($res, 45 ); edisdk_edifactwriter_set($res, 45, $value );
Default Value
''
Remarks
A reference value to associate this message with related messages.
This is an alphanumeric field with a value up to 35 characters long.
This property is not available at design time.
Data Type
String
MsgControllingAgency Property (EDISDK_EDIFACTWriter Class)
A code that identifies the controlling agency for this message type.
Object Oriented Interface
public function getMsgControllingAgency(); public function setMsgControllingAgency($value);
Procedural Interface
edisdk_edifactwriter_get($res, 46 ); edisdk_edifactwriter_set($res, 46, $value );
Default Value
''
Remarks
A code that identifies the controlling agency for this message type.
This is an alphanumeric field with a value up to 3 characters long.
This property is not available at design time.
Data Type
String
MsgFirstAndLastTransfer Property (EDISDK_EDIFACTWriter Class)
A single-character property that indicates the first and last messages in a related set.
Object Oriented Interface
public function getMsgFirstAndLastTransfer(); public function setMsgFirstAndLastTransfer($value);
Procedural Interface
edisdk_edifactwriter_get($res, 47 ); edisdk_edifactwriter_set($res, 47, $value );
Default Value
''
Remarks
A single-character field that indicates the first and last messages in a related set.
This property is not available at design time.
Data Type
String
MsgMessageImplControllingAgency Property (EDISDK_EDIFACTWriter Class)
A code value that identifies the controlling agency for the message implementation.
Object Oriented Interface
public function getMsgMessageImplControllingAgency(); public function setMsgMessageImplControllingAgency($value);
Procedural Interface
edisdk_edifactwriter_get($res, 48 ); edisdk_edifactwriter_set($res, 48, $value );
Default Value
''
Remarks
A code value that identifies the controlling agency for the message implementation.
This is an alphanumeric field with a value up to 3 characters long. This field only appears in EDIFACT syntax version 4.
This property is not available at design time.
Data Type
String
MsgMessageImplIdentification Property (EDISDK_EDIFACTWriter Class)
Identifies the message implementation.
Object Oriented Interface
public function getMsgMessageImplIdentification(); public function setMsgMessageImplIdentification($value);
Procedural Interface
edisdk_edifactwriter_get($res, 49 ); edisdk_edifactwriter_set($res, 49, $value );
Default Value
''
Remarks
Identifies the message implementation.
This is an alphanumeric field with a value up to 14 characters long. This field only appears in EDIFACT syntax version 4.
This property is not available at design time.
Data Type
String
MsgMessageImplRelease Property (EDISDK_EDIFACTWriter Class)
Identifies the release number for the message implementation.
Object Oriented Interface
public function getMsgMessageImplRelease(); public function setMsgMessageImplRelease($value);
Procedural Interface
edisdk_edifactwriter_get($res, 50 ); edisdk_edifactwriter_set($res, 50, $value );
Default Value
''
Remarks
Identifies the release number for the message implementation.
This is an alphanumeric field with a value up to 3 characters long. This field only appears in EDIFACT syntax version 4.
This property is not available at design time.
Data Type
String
MsgMessageImplVersion Property (EDISDK_EDIFACTWriter Class)
Identifies the version number for the message implementation.
Object Oriented Interface
public function getMsgMessageImplVersion(); public function setMsgMessageImplVersion($value);
Procedural Interface
edisdk_edifactwriter_get($res, 51 ); edisdk_edifactwriter_set($res, 51, $value );
Default Value
''
Remarks
Identifies the version number for the message implementation.
This is an alphanumeric field with a value up to 3 characters long. This field only appears in EDIFACT syntax version 4.
This property is not available at design time.
Data Type
String
MsgMessageRelease Property (EDISDK_EDIFACTWriter Class)
Identifies the release number for the message.
Object Oriented Interface
public function getMsgMessageRelease(); public function setMsgMessageRelease($value);
Procedural Interface
edisdk_edifactwriter_get($res, 52 ); edisdk_edifactwriter_set($res, 52, $value );
Default Value
''
Remarks
Identifies the release number for the message.
This is an alphanumeric field with a value up to 3 characters long.
This property is not available at design time.
Data Type
String
MsgMessageSubsetControllingAgency Property (EDISDK_EDIFACTWriter Class)
A code value that identifies the controlling agency for the message subset.
Object Oriented Interface
public function getMsgMessageSubsetControllingAgency(); public function setMsgMessageSubsetControllingAgency($value);
Procedural Interface
edisdk_edifactwriter_get($res, 53 ); edisdk_edifactwriter_set($res, 53, $value );
Default Value
''
Remarks
A code value that identifies the controlling agency for the message subset.
This is an alphanumeric field with a value up to 3 characters long. This field only appears in EDIFACT syntax version 4.
This property is not available at design time.
Data Type
String
MsgMessageSubsetIdentification Property (EDISDK_EDIFACTWriter Class)
Identifies the message subset.
Object Oriented Interface
public function getMsgMessageSubsetIdentification(); public function setMsgMessageSubsetIdentification($value);
Procedural Interface
edisdk_edifactwriter_get($res, 54 ); edisdk_edifactwriter_set($res, 54, $value );
Default Value
''
Remarks
Identifies the message subset.
This is an alphanumeric field with a value up to 14 characters long. This field only appears in EDIFACT syntax version 4.
This property is not available at design time.
Data Type
String
MsgMessageSubsetRelease Property (EDISDK_EDIFACTWriter Class)
Identifies the release number for the message subset.
Object Oriented Interface
public function getMsgMessageSubsetRelease(); public function setMsgMessageSubsetRelease($value);
Procedural Interface
edisdk_edifactwriter_get($res, 55 ); edisdk_edifactwriter_set($res, 55, $value );
Default Value
''
Remarks
Identifies the release number for the message subset.
This is an alphanumeric field with a value up to 3 characters long. This field only appears in EDIFACT syntax version 4.
This property is not available at design time.
Data Type
String
MsgMessageSubsetVersion Property (EDISDK_EDIFACTWriter Class)
Identifies the version number for the message subset.
Object Oriented Interface
public function getMsgMessageSubsetVersion(); public function setMsgMessageSubsetVersion($value);
Procedural Interface
edisdk_edifactwriter_get($res, 56 ); edisdk_edifactwriter_set($res, 56, $value );
Default Value
''
Remarks
Identifies the version number for the message subset.
This is an alphanumeric field with a value up to 3 characters long. This field only appears in EDIFACT syntax version 4.
This property is not available at design time.
Data Type
String
MsgMessageType Property (EDISDK_EDIFACTWriter Class)
A code identifying the message's type.
Object Oriented Interface
public function getMsgMessageType(); public function setMsgMessageType($value);
Procedural Interface
edisdk_edifactwriter_get($res, 57 ); edisdk_edifactwriter_set($res, 57, $value );
Default Value
''
Remarks
A code identifying the message's type.
This is an alphanumeric field with a value up to 6 characters long.
This property is not available at design time.
Data Type
String
MsgMessageTypeSubFunctionIdentification Property (EDISDK_EDIFACTWriter Class)
A code identifying the sub-function of the message's type.
Object Oriented Interface
public function getMsgMessageTypeSubFunctionIdentification(); public function setMsgMessageTypeSubFunctionIdentification($value);
Procedural Interface
edisdk_edifactwriter_get($res, 58 ); edisdk_edifactwriter_set($res, 58, $value );
Default Value
''
Remarks
A code identifying the sub-function of the message's type.
This is an alphanumeric field with a value up to 6 characters long. This field only appears in EDIFACT syntax version 4.
This property is not available at design time.
Data Type
String
MsgMessageVersion Property (EDISDK_EDIFACTWriter Class)
Identifies the version number for the message.
Object Oriented Interface
public function getMsgMessageVersion(); public function setMsgMessageVersion($value);
Procedural Interface
edisdk_edifactwriter_get($res, 59 ); edisdk_edifactwriter_set($res, 59, $value );
Default Value
''
Remarks
Identifies the version number for the message.
This is an alphanumeric field with a value up to 3 characters long.
This property is not available at design time.
Data Type
String
MsgReferenceNumber Property (EDISDK_EDIFACTWriter Class)
A unique reference number for the message.
Object Oriented Interface
public function getMsgReferenceNumber(); public function setMsgReferenceNumber($value);
Procedural Interface
edisdk_edifactwriter_get($res, 60 ); edisdk_edifactwriter_set($res, 60, $value );
Default Value
''
Remarks
A unique reference number for the message.
This is an alphanumeric field with a value up to 14 characters long.
This property is not available at design time.
Data Type
String
MsgScenarioControllingAgency Property (EDISDK_EDIFACTWriter Class)
Identifies the controlling agency for the message scenario.
Object Oriented Interface
public function getMsgScenarioControllingAgency(); public function setMsgScenarioControllingAgency($value);
Procedural Interface
edisdk_edifactwriter_get($res, 61 ); edisdk_edifactwriter_set($res, 61, $value );
Default Value
''
Remarks
Identifies the controlling agency for the message scenario.
This is an alphanumeric field with a value up to 3 characters long. This field only appears in EDIFACT syntax version 4.
This property is not available at design time.
Data Type
String
MsgScenarioIdentification Property (EDISDK_EDIFACTWriter Class)
The identifier for the message scenario.
Object Oriented Interface
public function getMsgScenarioIdentification(); public function setMsgScenarioIdentification($value);
Procedural Interface
edisdk_edifactwriter_get($res, 62 ); edisdk_edifactwriter_set($res, 62, $value );
Default Value
''
Remarks
The identifier for the message scenario.
This is an alphanumeric field with a value up to 14 characters long. This field only appears in EDIFACT syntax version 4.
This property is not available at design time.
Data Type
String
MsgScenarioRelease Property (EDISDK_EDIFACTWriter Class)
The message scenario's release number.
Object Oriented Interface
public function getMsgScenarioRelease(); public function setMsgScenarioRelease($value);
Procedural Interface
edisdk_edifactwriter_get($res, 63 ); edisdk_edifactwriter_set($res, 63, $value );
Default Value
''
Remarks
The message scenario's release number.
This is an alphanumeric field with a value up to 3 characters long. This field only appears in EDIFACT syntax version 4.
This property is not available at design time.
Data Type
String
MsgScenarioVersion Property (EDISDK_EDIFACTWriter Class)
The message scenario's version number.
Object Oriented Interface
public function getMsgScenarioVersion(); public function setMsgScenarioVersion($value);
Procedural Interface
edisdk_edifactwriter_get($res, 64 ); edisdk_edifactwriter_set($res, 64, $value );
Default Value
''
Remarks
The message scenario's version number.
This is an alphanumeric field with a value up to 3 characters long. This field only appears in EDIFACT syntax version 4.
This property is not available at design time.
Data Type
String
MsgSequenceOfTransfers Property (EDISDK_EDIFACTWriter Class)
Specifies the message's position in a sequence.
Object Oriented Interface
public function getMsgSequenceOfTransfers(); public function setMsgSequenceOfTransfers($value);
Procedural Interface
edisdk_edifactwriter_get($res, 65 ); edisdk_edifactwriter_set($res, 65, $value );
Default Value
''
Remarks
Specifies the message's position in a sequence.
This is an alphanumeric field with a value up to 2 characters long.
This property is not available at design time.
Data Type
String
OutputData Property (EDISDK_EDIFACTWriter Class)
The output data that has been written so far.
Object Oriented Interface
public function getOutputData(); public function setOutputData($value);
Procedural Interface
edisdk_edifactwriter_get($res, 66 ); edisdk_edifactwriter_set($res, 66, $value );
Default Value
''
Remarks
OutputData contains the entire EDI document that has been written so far. If writing to a file or stream, this property will be empty.
This property is not available at design time.
Data Type
String
OutputFile Property (EDISDK_EDIFACTWriter Class)
The name of the output file to which the EDI data will be written.
Object Oriented Interface
public function getOutputFile(); public function setOutputFile($value);
Procedural Interface
edisdk_edifactwriter_get($res, 67 ); edisdk_edifactwriter_set($res, 67, $value );
Default Value
''
Remarks
FileWriteMode property determines how the file is opened for writing. If OutputFile is empty, no file will be written and the OutputData property will contain the EDI data instead.
This property is not available at design time.
Data Type
String
SegmentSuffix Property (EDISDK_EDIFACTWriter Class)
The suffix that is appended to the end of a segment.
Object Oriented Interface
public function getSegmentSuffix(); public function setSegmentSuffix($value);
Procedural Interface
edisdk_edifactwriter_get($res, 68 ); edisdk_edifactwriter_set($res, 68, $value );
Possible Values
EDIFACTWRITER_SEGMENTSUFFIX_NONE(0),
EDIFACTWRITER_SEGMENTSUFFIX_CR(1),
EDIFACTWRITER_SEGMENTSUFFIX_LF(2),
EDIFACTWRITER_SEGMENTSUFFIX_CRLF(3)
Default Value
3
Remarks
Possible values are:
| ssNone (0) | No suffix is appended to the segment. |
| ssCR (1) | A carriage return (ASCII 13) is appended to the segment. |
| ssLF (2) | A line feed (ASCII 10) is appended to the segment. |
| ssCRLF (3) | A carriage return followed by a line feed (ASCII 13 and 10) is appended to the segment. This is the default value. |
This property is not available at design time.
Data Type
Integer
Close Method (EDISDK_EDIFACTWriter Class)
Closes the writer.
Object Oriented Interface
public function doClose();
Procedural Interface
edisdk_edifactwriter_do_close($res);
Remarks
Calling Close will close the writer and release any resources associated with it. After calling Close, the writer cannot be used unless it is re-initialized.
Config Method (EDISDK_EDIFACTWriter Class)
Sets or retrieves a configuration setting.
Object Oriented Interface
public function doConfig($configurationstring);
Procedural Interface
edisdk_edifactwriter_do_config($res, $configurationstring);
Remarks
Config is a generic method available in every class. It is used to set and retrieve configuration settings for the class.
These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the class, access to these internal properties is provided through the Config method.
To set a configuration setting named PROPERTY, you must call Config("PROPERTY=VALUE"), where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).
To read (query) the value of a configuration setting, you must call Config("PROPERTY"). The value will be returned as a string.
EndCompositeElement Method (EDISDK_EDIFACTWriter Class)
Finish writing the composite element.
Object Oriented Interface
public function doEndCompositeElement();
Procedural Interface
edisdk_edifactwriter_do_endcompositeelement($res);
Remarks
This method is used to close a CompositeElement. This method may only be called after a successful call to StartCompositeElement
EndFunctionalGroup Method (EDISDK_EDIFACTWriter Class)
Write the UNE(FunctionalGroup) segment to the output file/data/stream.
Object Oriented Interface
public function doEndFunctionalGroup();
Procedural Interface
edisdk_edifactwriter_do_endfunctionalgroup($res);
Remarks
This method is used to close a FunctionalGroup. This method may only be called after a successful call to StartFunctionalGroup
EndInterchange Method (EDISDK_EDIFACTWriter Class)
Write the UNZ(Interchange) segment to the output file/data/stream.
Object Oriented Interface
public function doEndInterchange();
Procedural Interface
edisdk_edifactwriter_do_endinterchange($res);
Remarks
This method is used to close an Interchange. This method may only be called after a successful call to StartInterchange
EndMessage Method (EDISDK_EDIFACTWriter Class)
Closes the current message.
Object Oriented Interface
public function doEndMessage();
Procedural Interface
edisdk_edifactwriter_do_endmessage($res);
Remarks
Calling this method will close the current message. If no message is open, an error will be raised. This method will also write the required Message Trailer (UNT) segment to the output.
EndSegment Method (EDISDK_EDIFACTWriter Class)
Finish writing the segment, add SegmentSuffix at the end of the segment.
Object Oriented Interface
public function doEndSegment();
Procedural Interface
edisdk_edifactwriter_do_endsegment($res);
Remarks
This method is used to close a Segment. This method may only be called after a successful call to StartSegment
Reset Method (EDISDK_EDIFACTWriter Class)
Resets all properties to their default values.
Object Oriented Interface
public function doReset();
Procedural Interface
edisdk_edifactwriter_do_reset($res);
Remarks
This method resets all properties of the component to their default values as specified in the property definitions.
StartCompositeElement Method (EDISDK_EDIFACTWriter Class)
Starts a composite element within the current segment.
Object Oriented Interface
public function doStartCompositeElement();
Procedural Interface
edisdk_edifactwriter_do_startcompositeelement($res);
Remarks
This method starts a composite element within the current segment. The composite element can contain multiple component elements. The composite element is ended by calling the EndCompositeElement method. Component elements within the composite are added by calling the WriteComponent method.
StartFunctionalGroup Method (EDISDK_EDIFACTWriter Class)
Starts a new functional group in the EDI document.
Object Oriented Interface
public function doStartFunctionalGroup();
Procedural Interface
edisdk_edifactwriter_do_startfunctionalgroup($res);
Remarks
This method starts a new functional group in the EDI document. The functional group fields must be set using the appropriate properties before calling this method. The functional group is ended by calling the EndFunctionalGroup method. The functional group header segment (UNG) is written to the output when this method is called.
StartInterchange Method (EDISDK_EDIFACTWriter Class)
Starts a new interchange in the EDI document.
Object Oriented Interface
public function doStartInterchange();
Procedural Interface
edisdk_edifactwriter_do_startinterchange($res);
Remarks
This method starts a new interchange in the EDI document. The interchange fields must be set using the appropriate properties before calling this method. The interchange is ended by calling the EndInterchange method. The interchange header segment (UNB) is written to the output when this method is called. If opening a new interchange would result in an invalid structure (for example, starting a new interchange before ending the previous one), an error will be raised.
StartMessage Method (EDISDK_EDIFACTWriter Class)
Starts a new message in the EDI document.
Object Oriented Interface
public function doStartMessage();
Procedural Interface
edisdk_edifactwriter_do_startmessage($res);
Remarks
This method starts a new message in the EDI document. The message fields must be set using the appropriate properties before calling this method. The message is ended by calling the EndMessage method. The message header segment (UNH) is written to the output when this method is called. If opening a new message would result in an invalid structure (for example, starting a new message before ending the previous one), an error will be raised.
StartSegment Method (EDISDK_EDIFACTWriter Class)
Starts a new segment with the specified tag.
Object Oriented Interface
public function doStartSegment($tag);
Procedural Interface
edisdk_edifactwriter_do_startsegment($res, $tag);
Remarks
This method starts a new segment with the specified tag. The segment is ended by calling the EndSegment method. Element values within the segment are added by calling the WriteElement method. Composite elements can be added to the segment by calling the StartCompositeElement method. If starting a new segment would result in an invalid structure (for example, starting a new segment before ending the previous one), an error will be raised.
WriteComponent Method (EDISDK_EDIFACTWriter Class)
Writes a class element value to the current composite element.
Object Oriented Interface
public function doWriteComponent($val);
Procedural Interface
edisdk_edifactwriter_do_writecomponent($res, $val);
Remarks
This method writes a component element value to the current composite element. The composite element must be started by calling the StartCompositeElement method before calling this method. The composite element is ended by calling the EndCompositeElement method. If this method is called when not within a composite element, an error will be raised.
WriteElement Method (EDISDK_EDIFACTWriter Class)
Writes an element value to the current segment.
Object Oriented Interface
public function doWriteElement($val);
Procedural Interface
edisdk_edifactwriter_do_writeelement($res, $val);
Remarks
This method writes an element value to the current segment. The segment must be started by calling the StartSegment method before calling this method. The segment is ended by calling the EndSegment method. If this method is called when not within a segment, an error will be raised.
Error Event (EDISDK_EDIFACTWriter Class)
Fires when an error occurs during message processing. Normally, the class fails with an error.
Object Oriented Interface
public function fireError($param);
Procedural Interface
edisdk_edifactwriter_register_callback($res, 1, array($this, 'fireError'));
Parameter List
'errorcode'
'description'
Remarks
The Error event is fired in case of exceptional conditions during message processing. Normally, the class fails with an error.
ConnectionId is the associated client Id, ErrorCode contains an error code, and Description contains a textual description of the error. For a list of valid error codes and their descriptions, please refer to the Error Codes section.
Output Event (EDISDK_EDIFACTWriter Class)
Fires when output data is written.
Object Oriented Interface
public function fireOutput($param);
Procedural Interface
edisdk_edifactwriter_register_callback($res, 2, array($this, 'fireOutput'));
Parameter List
'data'
Remarks
This event is fired when output data is written. The Data parameter contains the segment that was written.
Config Settings (EDIFACTWriter Class)
The class accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the class, access to these internal properties is provided through the Config method.Trappable Errors (EDIFACTWriter Class)
EDIFACTWriter Errors
| 202 | Invalid argument. |
| 304 | Cannot write to file. |
| 1099 | Encountered an unexpected segment tag. |
| 1100 | Attempted to perform an action while the component was busy, or close an incomplete interchange. |
| 1205 | Tried to perform an operation in a bad state (such as ending an interchange before starting one). |
| 1206 | Tried to end an interchange with no contents. |