PHP 클래스 EDI\Reader

파일 보기 프로젝트 열기: sabas/edifact 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( string $url = null ) Reader constructor.
errors ( ) Get errors
getParsedFile ( ) Returns the parsed file contained within.
groupsExtract ( type $start = 'LIN', type $barrier = ['UNS'] ) : boolean/array get groups from message when last segment is unknown but you know the barrier useful for invoices by default
load ( $url ) : boolean
preValidate ( ) : boolean Do initial validation
readEdiDataValue ( array/string $filter, integer $l1, $l2 = false, boolean $required = false ) : string/null read data value from parsed EDI data
readEdiDataValueReq ( $filter, $l1, boolean $l2 = false ) : string read required value. if no found, registre error
readEdiSegmentDTM ( integer $PeriodQualifier ) : string read date from DTM segment period qualifier - codelist 2005
readGroups ( char $before, type $start, type $end, type $after ) : boolean/array get groups from message
readTDTtransportIdentification ( $transportStageQualifier ) : string read transport identification number
readUNBDateTimeOfPpreperation ( )
readUNBDateTimeOfPreperation ( ) : mixed | string get message preparation time
readUNHmessageNumber ( ) : string read message number
readUNHmessageType ( ) : string read message type
resetErrors ( ) reset errors
setParsedFile ( array $parsed_file ) : boolean
splitMultiMessage ( $ediMessage ) : array Split multi messages to separate messages

비공개 메소드들

메소드 설명
unwrap ( $string ) : array unwrap string splitting rows on terminator (if not escaped)

메소드 상세

__construct() 공개 메소드

Reader constructor.
public __construct ( string $url = null )
$url string url or path ur EDI message

errors() 공개 메소드

Get errors
public errors ( )

getParsedFile() 공개 메소드

Returns the parsed file contained within.
public getParsedFile ( )

groupsExtract() 공개 메소드

get groups from message when last segment is unknown but you know the barrier useful for invoices by default
public groupsExtract ( type $start = 'LIN', type $barrier = ['UNS'] ) : boolean/array
$start type first segment start a new group
$barrier type barrier segment (NOT in group)
리턴 boolean/array

load() 공개 메소드

public load ( $url ) : boolean
$url string url to edi file, path to edi file or EDI message
리턴 boolean

preValidate() 공개 메소드

Do initial validation
public preValidate ( ) : boolean
리턴 boolean

readEdiDataValue() 공개 메소드

read data value from parsed EDI data
public readEdiDataValue ( array/string $filter, integer $l1, $l2 = false, boolean $required = false ) : string/null
$filter array/string
$l1 integer first level item number (start by 1)
$required boolean if required, but no exist, register error
리턴 string/null

readEdiDataValueReq() 공개 메소드

read required value. if no found, registre error
public readEdiDataValueReq ( $filter, $l1, boolean $l2 = false ) : string
$filter string|array segment filter by segment name and values
$l1
$l2 boolean
리턴 string

readEdiSegmentDTM() 공개 메소드

read date from DTM segment period qualifier - codelist 2005
public readEdiSegmentDTM ( integer $PeriodQualifier ) : string
$PeriodQualifier integer period qualifier (codelist/2005)
리턴 string YYYY-MM-DD HH:MM:SS

readGroups() 공개 메소드

get groups from message
public readGroups ( char $before, type $start, type $end, type $after ) : boolean/array
$before char segment before groups
$start type first segment of group
$end type last segment of group
$after type segment after groups
리턴 boolean/array

readTDTtransportIdentification() 공개 메소드

read transport identification number
public readTDTtransportIdentification ( $transportStageQualifier ) : string
$transportStageQualifier
리턴 string

readUNBDateTimeOfPpreperation() 공개 메소드

사용 중단:

readUNBDateTimeOfPreperation() 공개 메소드

get message preparation time

readUNHmessageNumber() 공개 메소드

read message number
public readUNHmessageNumber ( ) : string
리턴 string

readUNHmessageType() 공개 메소드

read message type
public readUNHmessageType ( ) : string
리턴 string

resetErrors() 공개 메소드

reset errors
public resetErrors ( )

setParsedFile() 공개 메소드

public setParsedFile ( array $parsed_file ) : boolean
$parsed_file array array
리턴 boolean

splitMultiMessage() 공개 정적인 메소드

Split multi messages to separate messages
public static splitMultiMessage ( $ediMessage ) : array
$ediMessage string
리턴 array