/** * Generate the alelo orders file. * * @return string */ public function generate() { if ($this->productType === null) { throw new ProductTypeIsRequiredException(); } $this->header = new HeaderRegistry(['requesterUser' => $this->orderUser, 'orderDate' => (new Carbon())->format('Ymd'), 'orderTime' => (new Carbon())->format('H.i.s')]); $this->generateTraillerRegistry(); $this->fileLayout = $this->fileLayout->append($this->header->__toString()); $this->fileLayout = $this->fileLayout->append(PHP_EOL); $this->fileLayout = $this->fileLayout->append($this->headerEletronic->__toString()); $this->fileLayout = $this->fileLayout->append(PHP_EOL); $this->fileLayout = $this->fileLayout->append($this->branch->__toString()); $this->fileLayout = $this->fileLayout->append(PHP_EOL); foreach ($this->getAllEmployees() as $employeeRegistry) { $this->fileLayout = $this->fileLayout->append($employeeRegistry->__toString()); $this->fileLayout = $this->fileLayout->append(PHP_EOL); } $this->fileLayout = $this->fileLayout->append($this->traillerRegistry->__toString()); return $this->fileLayout->__toString(); }
/** * Generate the alelo orders file. * * @return string */ public function generate() { $this->generateTraillerRegistry(); $this->fileLayout = $this->fileLayout->append($this->header->__toString()); $this->fileLayout = $this->fileLayout->append(PHP_EOL); $this->fileLayout = $this->fileLayout->append($this->branch->__toString()); $this->fileLayout = $this->fileLayout->append(PHP_EOL); foreach ($this->getAllEmployees() as $employeeRegistry) { $this->fileLayout = $this->fileLayout->append($employeeRegistry->__toString()); $this->fileLayout = $this->fileLayout->append(PHP_EOL); } $this->fileLayout = $this->fileLayout->append($this->traillerRegistry->__toString()); return (string) $this->fileLayout; }