oms-Billing/Models/BillTypeL11n.php
2022-02-19 13:57:38 +01:00

137 lines
2.4 KiB
PHP
Executable File

<?php
/**
* Karaka
*
* PHP Version 8.0
*
* @package Modules\Billing\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://karaka.app
*/
declare(strict_types=1);
namespace Modules\Billing\Models;
use phpOMS\Contract\ArrayableInterface;
use phpOMS\Localization\ISO639x1Enum;
/**
* Billing class.
*
* @package Modules\Billing\Models
* @license OMS License 1.0
* @link https://karaka.app
* @since 1.0.0
*/
class BillTypeL11n implements \JsonSerializable, ArrayableInterface
{
/**
* Type ID.
*
* @var int
* @since 1.0.0
*/
protected int $id = 0;
/**
* Type.
*
* @var int
* @since 1.0.0
*/
public int | BillType $type = 0;
/**
* Language.
*
* @var string
* @since 1.0.0
*/
protected string $language = ISO639x1Enum::_EN;
/**
* Name.
*
* @var string
* @since 1.0.0
*/
public string $name = '';
/**
* Constructor.
*
* @param int|BillType $type Attribute type
* @param string $name Localized name
* @param string $language Language
*
* @since 1.0.0
*/
public function __construct(int | BillType $type = 0, string $name = '', string $language = ISO639x1Enum::_EN)
{
$this->type = $type;
$this->name = $name;
$this->language = $language;
}
/**
* Get id
*
* @return int
*
* @since 1.0.0
*/
public function getId() : int
{
return $this->id;
}
/**
* Get language
*
* @return string
*
* @since 1.0.0
*/
public function getLanguage() : string
{
return $this->language;
}
/**
* Set language
*
* @param string $language Language
*
* @return void
*
* @since 1.0.0
*/
public function setLanguage(string $language) : void
{
$this->language = $language;
}
/**
* {@inheritdoc}
*/
public function toArray() : array
{
return [
'id' => $this->id,
'name' => $this->name,
'type' => $this->type,
'language' => $this->language,
];
}
/**
* {@inheritdoc}
*/
public function jsonSerialize()
{
return $this->toArray();
}
}