コード例 #1
0
ファイル: Populator.php プロジェクト: progrupa/edifact
 protected function fromSegment($object, MessageSegment $segment)
 {
     $classRefl = new \ReflectionClass($object);
     //  Check if proper segment was received
     $this->checkSegmentCode($classRefl, $segment->getCode());
     //  Populate SegmentPiece properties
     $this->fillFromArray($object, $classRefl, array_values($segment->getRawData()));
     //  Check if mandatory fields have values
     $this->checkMandatoryFields($object, $classRefl, $segment->getCode());
 }
コード例 #2
0
 public function acceptSegment(Segment $segment)
 {
     if ($this->getCode() == $segment->getCode() && $this->maxRepeat > count($this->segments)) {
         $this->segments[] = $segment;
         return true;
     } else {
         return false;
     }
 }