oms-Tasks/Models/AccountRelationMapper.php
Dennis Eichhorn 66aa098313 ui fixes
2024-04-07 17:31:42 +00:00

75 lines
1.9 KiB
PHP
Executable File

<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Tasks\Models
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
namespace Modules\Tasks\Models;
use Modules\Admin\Models\AccountMapper;
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
/**
* AccountRelation mapper class.
*
* @package Modules\Tasks\Models
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*
* @template T of AccountRelation
* @extends DataMapperFactory<T>
*/
final class AccountRelationMapper extends DataMapperFactory
{
/**
* Columns.
*
* @var array<string, array{name:string, type:string, internal:string, autocomplete?:bool, readonly?:bool, writeonly?:bool, annotations?:array}>
* @since 1.0.0
*/
public const COLUMNS = [
'task_account_id' => ['name' => 'task_account_id', 'type' => 'int', 'internal' => 'id'],
'task_account_duty' => ['name' => 'task_account_duty', 'type' => 'int', 'internal' => 'duty'],
'task_account_account' => ['name' => 'task_account_account', 'type' => 'int', 'internal' => 'relation'],
'task_account_task_element' => ['name' => 'task_account_task_element', 'type' => 'int', 'internal' => 'element'],
];
/**
* Has one relation.
*
* @var array<string, array{mapper:class-string, external:string, by?:string, column?:string, conditional?:bool}>
* @since 1.0.0
*/
public const OWNS_ONE = [
'relation' => [
'mapper' => AccountMapper::class,
'external' => 'task_account_account',
],
];
/**
* Primary table.
*
* @var string
* @since 1.0.0
*/
public const TABLE = 'task_account';
/**
* Primary field name.
*
* @var string
* @since 1.0.0
*/
public const PRIMARYFIELD = 'task_account_id';
}