Documentation

Message
in package
implements MessageInterface

FinalYes

Represent an EDI message for both reading and writing.

Table of Contents

Interfaces

MessageInterface

Properties

$segments  : array<string|int, SegmentInterface>

Methods

__toString()  : mixed
Allow the object to be serialized by casting to a string.
addSegment()  : $this
Add a segment to the message.
addSegments()  : $this
Add multiple segments to the message.
fromFile()  : self
Create a new instance from a file.
fromSegments()  : self
Create a new instance from an array of segments.
fromString()  : self
Create a new instance from a string.
getAllSegments()  : array<string|int, SegmentInterface>
Get all the segments.
getSegment()  : SegmentInterface|null
Get the first segment that matches the requested code.
getSegments()  : iterable<string|int, SegmentInterface>
Get all the segments that match the requested code.
serialize()  : string
Serialize all the segments added to this object.

Properties

Methods

__toString()

Allow the object to be serialized by casting to a string.

public __toString() : mixed

fromFile()

Create a new instance from a file.

public static fromFile(string $file) : self
Parameters
$file : string

The full path to a file that contains an EDI message

Tags
throws
ParseException
Return values
self

fromString()

Create a new instance from a string.

public static fromString(string $string) : self
Parameters
$string : string
Tags
throws
ParseException
Return values
self

getSegments()

Get all the segments that match the requested code.

public getSegments(string $code) : iterable<string|int, SegmentInterface>
Parameters
$code : string
Return values
iterable<string|int, SegmentInterface>

serialize()

Serialize all the segments added to this object.

public serialize() : string
Return values
string
On this page

Search results