mirror of
https://github.com/Karaka-Management/oms-Media.git
synced 2026-02-08 13:38:42 +00:00
Testing relation mapping
This commit is contained in:
parent
e3080fd299
commit
0e144f25da
|
|
@ -21,12 +21,13 @@ use phpOMS\DataStorage\Database\Query\Column;
|
||||||
class CollectionMapper extends MediaMapper
|
class CollectionMapper extends MediaMapper
|
||||||
{
|
{
|
||||||
protected static $hasMany = [
|
protected static $hasMany = [
|
||||||
'source' => [
|
'sources' => [
|
||||||
'mapper' => null,
|
'mapper' => '\Modules\Media\Models\MediaMapper', /* mapper of the related object */
|
||||||
'table' => 'media_relation',
|
'relationmapper' => null, /* if the relation itself is a more complex object that has it's own mapper */
|
||||||
'dst' => 'media_relation_dst',
|
'table' => 'media_relation', /* table of the related object, null if no relation table is used (many->1) */
|
||||||
'src' => 'media_relation_src'
|
'dst' => 'media_relation_dst',
|
||||||
]
|
'src' => 'media_relation_src',
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ class MediaMapper extends DataMapperAbstract
|
||||||
'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_extension' => ['name' => 'media_extension', 'type' => 'string', 'internal' => 'extension'],
|
'media_extension' => ['name' => 'media_extension', 'type' => 'string', 'internal' => 'extension'],
|
||||||
'media_collection' => ['name' => 'media_collection', 'type' => 'int', 'internal' => 'collection'],
|
'media_collection' => ['name' => 'media_collection', 'type' => 'bool', 'internal' => 'collection'],
|
||||||
'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'],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user