|
- <?php
-
- namespace App\Logic\ReceiptIssuingOrder\Custom\HelloTechno;
-
- use App\Logic\ReceiptIssuingOrder\CreateManager as BaseManager;
- use App\Models\ReceiptIssuingHTParkingCustomOrder;
-
- class CreateManager
- {
-
- public function __construct(
- protected BaseManager $manager,
- private ReceiptIssuingHTParkingCustomOrder $customOrder,
- ) {
- }
-
- public function init(): static
- {
- $this->manager->init();
- return $this;
- }
-
- public function fill(array $attr): static
- {
- $this->manager->fill($attr);
- $this->customOrder->fill($attr);
-
- return $this;
- }
-
- public function create(): array
- {
- $messages = $this->manager->create();
-
- if (count($messages) !== 0) {
- return $messages;
- }
-
- $this->customOrder->setReceiptIssuingOrder($this->manager->id());
- $this->customOrder->save();
-
- return [];
- }
- }
|