mirror of
https://github.com/Karaka-Management/oms-Media.git
synced 2026-02-08 13:38:42 +00:00
correct datamapper self/external usage (invert)
This commit is contained in:
parent
41c1cb2b28
commit
0e0e0d1042
|
|
@ -14,6 +14,11 @@
|
|||
"type": "VARCHAR(255)",
|
||||
"null": false
|
||||
},
|
||||
"media_type": {
|
||||
"name": "media_type",
|
||||
"type": "VARCHAR(255)",
|
||||
"null": false
|
||||
},
|
||||
"media_description": {
|
||||
"name": "media_description",
|
||||
"type": "TEXT",
|
||||
|
|
|
|||
|
|
@ -27,6 +27,14 @@ use phpOMS\Module\WebInterface;
|
|||
*/
|
||||
class Controller extends ModuleAbstract implements WebInterface
|
||||
{
|
||||
/**
|
||||
* File path
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const FILE_PATH = __DIR__ . '/../Files';
|
||||
|
||||
/**
|
||||
* Module path.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@ final class CollectionMapper extends MediaMapper
|
|||
'sources' => [
|
||||
'mapper' => MediaMapper::class,
|
||||
'table' => 'media_relation',
|
||||
'external' => 'media_relation_dst',
|
||||
'self' => 'media_relation_src',
|
||||
'external' => 'media_relation_src',
|
||||
'self' => 'media_relation_dst',
|
||||
],
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -43,6 +43,14 @@ class Media implements \JsonSerializable
|
|||
*/
|
||||
protected string $name = '';
|
||||
|
||||
/**
|
||||
* Type.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected string $type = '';
|
||||
|
||||
/**
|
||||
* Extension.
|
||||
*
|
||||
|
|
@ -360,6 +368,16 @@ class Media implements \JsonSerializable
|
|||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getType() : string
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*
|
||||
|
|
@ -460,6 +478,19 @@ class Media implements \JsonSerializable
|
|||
$this->name = $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $type Media type
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function setType(string $type) : void
|
||||
{
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $description Media description
|
||||
*
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ class MediaMapper extends DataMapperAbstract
|
|||
protected static array $columns = [
|
||||
'media_id' => ['name' => 'media_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'media_name' => ['name' => 'media_name', 'type' => 'string', 'internal' => 'name', 'autocomplete' => true],
|
||||
'media_type' => ['name' => 'media_type', 'type' => 'string', 'internal' => 'type'],
|
||||
'media_description' => ['name' => 'media_description', 'type' => 'string', 'internal' => 'description', 'autocomplete' => true],
|
||||
'media_description_raw' => ['name' => 'media_description_raw', 'type' => 'string', 'internal' => 'descriptionRaw'],
|
||||
'media_versioned' => ['name' => 'media_versioned', 'type' => 'bool', 'internal' => 'versioned'],
|
||||
|
|
@ -61,7 +62,7 @@ class MediaMapper extends DataMapperAbstract
|
|||
protected static array $belongsTo = [
|
||||
'createdBy' => [
|
||||
'mapper' => AccountMapper::class,
|
||||
'self' => 'media_created_by',
|
||||
'external' => 'media_created_by',
|
||||
],
|
||||
];
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user