- Add subuser ID management to `selfserve_lane_command_arguments`. - Update `invoice` function to include optional command arguments. - Attach metadata to orders with self-serve and subuser details. - Introduce `OTHER_TYPE_SELF_SERVE_WASH` in `attachment_content`.
54 lines
1.6 KiB
PHP
54 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace attachments\helpers;
|
|
|
|
class attachment_content
|
|
{
|
|
const OTHER_TYPE_WASH_CERTIFICATE = 'WASH_CERTIFICATE';
|
|
const OTHER_TYPE_SELF_SERVE_WASH = 'SELF_SERVE_WASH';
|
|
public ?string $image; // Used to store the attachment object name, in the attachment store.
|
|
public ?string $document; // Used to store the attachment object name, in the attachment store.
|
|
public ?attachment_relation $relation; // Used to store the attachment relation object.
|
|
public mixed $other; // Used to store the attachment object. (if any other type)
|
|
|
|
public function __construct(?object $data = null)
|
|
{
|
|
$this->image = $data->image ?? null;
|
|
$this->document = $data->document ?? null;
|
|
$this->relation = isset($data->relation) ? new attachment_relation($data->relation) : null;
|
|
$this->other = $data->other ?? null;
|
|
}
|
|
|
|
public function toArray(): array
|
|
{
|
|
return [
|
|
'image' => $this->image,
|
|
'document' => $this->document,
|
|
'relation' => $this->relation ? $this->relation->toArray() : null,
|
|
'other' => $this->other,
|
|
];
|
|
}
|
|
|
|
/** Setters */
|
|
public function setOther(mixed $string): self
|
|
{
|
|
$this->other = $string;
|
|
return $this;
|
|
}
|
|
public function setImage(string $string): self
|
|
{
|
|
$this->image = $string;
|
|
return $this;
|
|
}
|
|
public function setDocument(string $string): self
|
|
{
|
|
$this->document = $string;
|
|
return $this;
|
|
}
|
|
public function setRelation(attachment_relation $relation): self
|
|
{
|
|
$this->relation = $relation;
|
|
return $this;
|
|
}
|
|
}
|