oms-ItemManagement/Models/ItemAttributeType.php

108 lines
1.9 KiB
PHP

<?php
/**
* Orange Management
*
* PHP Version 7.4
*
* @package Modules\ItemManagement\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\ItemManagement\Models;
use phpOMS\Contract\ArrayableInterface;
/**
* Item Attribute Type class.
*
* @package Modules\ItemManagement\Models
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
class ItemAttributeType implements \JsonSerializable, ArrayableInterface
{
/**
* Id
*
* @var int
* @since 1.0.0
*/
protected int $id = 0;
/**
* Name/string identifier by which it can be found/categorized
*
* @var string
* @since 1.0.0
*/
protected string $name = '';
/**
* Which field data type is required (string, int, ...) in the value
*
* @var int
* @since 1.0.0
*/
protected int $fields = 0;
/**
* Is a custom value allowed (e.g. custom string)
*
* @var bool
* @since 1.0.0
*/
protected bool $custom = false;
/**
* Localization
*
* @var int|int[]|ItemAttributeTypeL11n|ItemAttributeTypeL11n[]
*/
protected $l11n = 0;
/**
* Constructor.
*
* @param string $name Name/identifier of the attribute type
*
* @since 1.0.0
*/
public function __construct(string $name = '')
{
$this->name = $name;
}
/**
* Get id
*
* @return int
*
* @since 1.0.0
*/
public function getId() : int
{
return $this->id;
}
/**
* {@inheritdoc}
*/
public function toArray() : array
{
return [];
}
/**
* {@inheritdoc}
*/
public function jsonSerialize()
{
return $this->toArray();
}
}