oms-Billing/Models/BillTypeMapper.php
2021-02-20 10:01:44 +00:00

97 lines
2.5 KiB
PHP
Executable File

<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\Billing\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\Billing\Models;
use phpOMS\DataStorage\Database\DataMapperAbstract;
/**
* Billing mapper class.
*
* @package Modules\Billing\Models
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
final class BillTypeMapper extends DataMapperAbstract
{
/**
* Columns.
*
* @var array<string, array{name:string, type:string, internal:string, autocomplete?:bool, readonly?:bool, writeonly?:bool, annotations?:array}>
* @since 1.0.0
*/
protected static array $columns = [
'billing_type_id' => ['name' => 'billing_type_id', 'type' => 'int', 'internal' => 'id'],
'billing_type_transfer_type' => ['name' => 'billing_type_transfer_type', 'type' => 'int', 'internal' => 'transferType'],
'billing_type_transfer_stock' => ['name' => 'billing_type_transfer_stock', 'type' => 'bool', 'internal' => 'transferStock'],
];
/**
* Has many relation.
*
* @var array<string, array{mapper:string, table:string, self?:?string, external?:?string, column?:string}>
* @since 1.0.0
*/
protected static array $hasMany = [
'l11n' => [
'mapper' => BillTypeL11nMapper::class,
'table' => 'billing_type_l11n',
'self' => 'billing_type_l11n_type',
'column' => 'name',
'conditional' => true,
'external' => null,
],
];
/**
* Belongs to.
*
* @var array<string, array{mapper:string, self:string}>
* @since 1.0.0
*/
/*
protected static array $belongsTo = [
'owner' => [
'mapper' => AccountMapper::class,
'external' => 'billing_type_owner',
],
];
*/
/**
* Model to use by the mapper.
*
* @var string
* @since 1.0.0
*/
protected static string $model = BillType::class;
/**
* Primary table.
*
* @var string
* @since 1.0.0
*/
protected static string $table = 'billing_type';
/**
* Primary field name.
*
* @var string
* @since 1.0.0
*/
protected static string $primaryField = 'billing_type_id';
}