mirror of
https://github.com/Karaka-Management/oms-ItemManagement.git
synced 2026-01-11 11:48:41 +00:00
78 lines
1.3 KiB
PHP
78 lines
1.3 KiB
PHP
<?php
|
|
/**
|
|
* Jingga
|
|
*
|
|
* PHP Version 8.2
|
|
*
|
|
* @package Modules\ItemManagement\Models
|
|
* @copyright Dennis Eichhorn
|
|
* @license OMS License 2.0
|
|
* @version 1.0.0
|
|
* @link https://jingga.app
|
|
*/
|
|
declare(strict_types=1);
|
|
|
|
namespace Modules\ItemManagement\Models;
|
|
|
|
use phpOMS\Localization\BaseStringL11nType;
|
|
use phpOMS\Localization\NullBaseStringL11nType;
|
|
|
|
/**
|
|
* Material class.
|
|
*
|
|
* @package Modules\ItemManagement\Models
|
|
* @license OMS License 2.0
|
|
* @link https://jingga.app
|
|
* @since 1.0.0
|
|
*/
|
|
class Material implements \JsonSerializable
|
|
{
|
|
/**
|
|
* ID.
|
|
*
|
|
* @var int
|
|
* @since 1.0.0
|
|
*/
|
|
public int $id = 0;
|
|
|
|
public int $category = 0;
|
|
|
|
public int $subcategory = 0;
|
|
|
|
public BaseStringL11nType $type;
|
|
|
|
public int $quantity = 0;
|
|
|
|
public string $unit = 'pcs';
|
|
|
|
public int $item = 0;
|
|
|
|
/**
|
|
* Constructor.
|
|
*
|
|
* @since 1.0.0
|
|
*/
|
|
public function __construct()
|
|
{
|
|
$this->type = new NullBaseStringL11nType();
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function toArray() : array
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
];
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function jsonSerialize() : mixed
|
|
{
|
|
return $this->toArray();
|
|
}
|
|
}
|