oms-Accounting/Models/CostObjectMapper.php
2020-12-03 23:07:33 +01:00

80 lines
2.0 KiB
PHP

<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\Accounting\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\Accounting\Models;
use phpOMS\DataStorage\Database\DataMapperAbstract;
/**
* Accounting mapper class.
*
* @package Modules\Accounting\Models
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
final class CostObjectMapper 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 = [
'accounting_costobject_id' => ['name' => 'accounting_costobject_id', 'type' => 'int', 'internal' => 'id'],
'accounting_costobject_code' => ['name' => 'accounting_costobject_code', 'type' => 'string', 'internal' => 'code'],
];
/**
* 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' => L11nCostObjectMapper::class,
'table' => 'accounting_costobject_l11n',
'self' => 'accounting_costobject_l11n_costobject',
'conditional' => true,
'external' => null,
],
];
/**
* Model to use by the mapper.
*
* @var string
* @since 1.0.0
*/
protected static string $model = CostObject::class;
/**
* Primary table.
*
* @var string
* @since 1.0.0
*/
protected static string $table = 'accounting_costobject';
/**
* Primary field name.
*
* @var string
* @since 1.0.0
*/
protected static string $primaryField = 'accounting_costobject_id';
}