mirror of
https://github.com/Karaka-Management/oms-Media.git
synced 2026-01-20 04:58:41 +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
|
||||
{
|
||||
protected static $hasMany = [
|
||||
'source' => [
|
||||
'mapper' => null,
|
||||
'table' => 'media_relation',
|
||||
'dst' => 'media_relation_dst',
|
||||
'src' => 'media_relation_src'
|
||||
]
|
||||
'sources' => [
|
||||
'mapper' => '\Modules\Media\Models\MediaMapper', /* mapper of the related object */
|
||||
'relationmapper' => null, /* if the relation itself is a more complex object that has it's own mapper */
|
||||
'table' => 'media_relation', /* table of the related object, null if no relation table is used (many->1) */
|
||||
'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_file' => ['name' => 'media_file', 'type' => 'string', 'internal' => 'path'],
|
||||
'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_created_by' => ['name' => 'media_created_by', 'type' => 'int', 'internal' => 'createdBy'],
|
||||
'media_created_at' => ['name' => 'media_created_at', 'type' => 'DateTime', 'internal' => 'createdAt'],
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user