mirror of
https://github.com/Karaka-Management/oms-Media.git
synced 2026-02-14 16:28:41 +00:00
Re-format mappers
This commit is contained in:
parent
a72f336040
commit
72012cd811
|
|
@ -22,10 +22,10 @@ class CollectionMapper extends MediaMapper
|
||||||
{
|
{
|
||||||
protected static $hasMany = [
|
protected static $hasMany = [
|
||||||
'sources' => [
|
'sources' => [
|
||||||
'mapper' => MediaMapper::class, /* mapper of the related object */
|
'mapper' => MediaMapper::class, /* mapper of the related object */
|
||||||
'table' => 'media_relation', /* table of the related object, null if no relation table is used (many->1) */
|
'table' => 'media_relation', /* table of the related object, null if no relation table is used (many->1) */
|
||||||
'dst' => 'media_relation_dst',
|
'dst' => 'media_relation_dst',
|
||||||
'src' => 'media_relation_src',
|
'src' => 'media_relation_src',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,23 +30,23 @@ class MediaMapper extends DataMapperAbstract
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected static $columns = [
|
protected static $columns = [
|
||||||
'media_id' => ['name' => 'media_id', 'type' => 'int', 'internal' => 'id'],
|
'media_id' => ['name' => 'media_id', 'type' => 'int', 'internal' => 'id'],
|
||||||
'media_name' => ['name' => 'media_name', 'type' => 'string', 'internal' => 'name'],
|
'media_name' => ['name' => 'media_name', 'type' => 'string', 'internal' => 'name'],
|
||||||
'media_description' => ['name' => 'media_description', 'type' => 'string', 'internal' => 'description'],
|
'media_description' => ['name' => 'media_description', 'type' => 'string', 'internal' => 'description'],
|
||||||
'media_description_raw' => ['name' => 'media_description_raw', 'type' => 'string', 'internal' => 'descriptionRaw'],
|
'media_description_raw' => ['name' => 'media_description_raw', 'type' => 'string', 'internal' => 'descriptionRaw'],
|
||||||
'media_versioned' => ['name' => 'media_versioned', 'type' => 'bool', 'internal' => 'versioned'],
|
'media_versioned' => ['name' => 'media_versioned', 'type' => 'bool', 'internal' => 'versioned'],
|
||||||
'media_file' => ['name' => 'media_file', 'type' => 'string', 'internal' => 'path'],
|
'media_file' => ['name' => 'media_file', 'type' => 'string', 'internal' => 'path'],
|
||||||
'media_absolute' => ['name' => 'media_absolute', 'type' => 'bool', 'internal' => 'isAbsolute'],
|
'media_absolute' => ['name' => 'media_absolute', 'type' => 'bool', 'internal' => 'isAbsolute'],
|
||||||
'media_extension' => ['name' => 'media_extension', 'type' => 'string', 'internal' => 'extension'],
|
'media_extension' => ['name' => 'media_extension', 'type' => 'string', 'internal' => 'extension'],
|
||||||
'media_size' => ['name' => 'media_size', 'type' => 'int', 'internal' => 'size'],
|
'media_size' => ['name' => 'media_size', 'type' => 'int', 'internal' => 'size'],
|
||||||
'media_created_by' => ['name' => 'media_created_by', 'type' => 'int', 'internal' => 'createdBy'],
|
'media_created_by' => ['name' => 'media_created_by', 'type' => 'int', 'internal' => 'createdBy'],
|
||||||
'media_created_at' => ['name' => 'media_created_at', 'type' => 'DateTime', 'internal' => 'createdAt'],
|
'media_created_at' => ['name' => 'media_created_at', 'type' => 'DateTime', 'internal' => 'createdAt'],
|
||||||
];
|
];
|
||||||
|
|
||||||
protected static $belongsTo = [
|
protected static $belongsTo = [
|
||||||
'createdBy' => [
|
'createdBy' => [
|
||||||
'mapper' => AccountMapper::class,
|
'mapper' => AccountMapper::class,
|
||||||
'dest' => 'media_created_by',
|
'dest' => 'media_created_by',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user