oms-Media/Models/CollectionMapper.php

74 lines
1.5 KiB
PHP
Executable File

<?php
/**
* Orange Management
*
* PHP Version 7.4
*
* @package Modules\Media\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\Media\Models;
/**
* Mapper class.
*
* @package Modules\Media\Models
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
final class CollectionMapper extends MediaMapper
{
/**
* 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 = [
'sources' => [
'mapper' => MediaMapper::class,
'table' => 'media_relation',
'external' => 'media_relation_dst',
'self' => 'media_relation_src',
],
];
/**
* Model to use by the mapper.
*
* @var string
* @since 1.0.0
*/
protected static string $model = Collection::class;
/**
* Primary table.
*
* @var string
* @since 1.0.0
*/
protected static string $table = 'media';
/**
* Created at.
*
* @var string
* @since 1.0.0
*/
protected static string $createdAt = 'media_created_at';
/**
* Primary field name.
*
* @var string
* @since 1.0.0
*/
protected static string $primaryField = 'media_id';
}