todo implementations

This commit is contained in:
Dennis Eichhorn 2021-11-20 17:10:09 +01:00
parent bc5a307734
commit e526749bde
6 changed files with 110 additions and 25 deletions

View File

@ -58,6 +58,13 @@
"primary": true, "primary": true,
"autoincrement": true "autoincrement": true
}, },
"editor_doc_type": {
"name": "editor_doc_type",
"type": "INT",
"null": true,
"foreignTable": "editor_doc_type",
"foreignKey": "editor_doc_type_id"
},
"editor_doc_title": { "editor_doc_title": {
"name": "editor_doc_title", "name": "editor_doc_title",
"type": "VARCHAR(255)", "type": "VARCHAR(255)",

View File

@ -37,15 +37,15 @@ final class EditorDocMapper extends DataMapperAbstract
* @since 1.0.0 * @since 1.0.0
*/ */
protected static array $columns = [ protected static array $columns = [
'editor_doc_id' => ['name' => 'editor_doc_id', 'type' => 'int', 'internal' => 'id'], 'editor_doc_id' => ['name' => 'editor_doc_id', 'type' => 'int', 'internal' => 'id'],
'editor_doc_created_by' => ['name' => 'editor_doc_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true], 'editor_doc_created_by' => ['name' => 'editor_doc_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true],
'editor_doc_title' => ['name' => 'editor_doc_title', 'type' => 'string', 'internal' => 'title'], 'editor_doc_title' => ['name' => 'editor_doc_title', 'type' => 'string', 'internal' => 'title'],
'editor_doc_plain' => ['name' => 'editor_doc_plain', 'type' => 'string', 'internal' => 'plain'], 'editor_doc_plain' => ['name' => 'editor_doc_plain', 'type' => 'string', 'internal' => 'plain'],
'editor_doc_content' => ['name' => 'editor_doc_content', 'type' => 'string', 'internal' => 'content'], 'editor_doc_content' => ['name' => 'editor_doc_content', 'type' => 'string', 'internal' => 'content'],
'editor_doc_type' => ['name' => 'editor_doc_type', 'type' => 'int', 'internal' => 'type'], 'editor_doc_type' => ['name' => 'editor_doc_type', 'type' => 'int', 'internal' => 'type'],
'editor_doc_virtual' => ['name' => 'editor_doc_virtual', 'type' => 'string', 'internal' => 'virtualPath'], 'editor_doc_virtual' => ['name' => 'editor_doc_virtual', 'type' => 'string', 'internal' => 'virtualPath'],
'editor_doc_created_at' => ['name' => 'editor_doc_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true], 'editor_doc_created_at' => ['name' => 'editor_doc_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
'editor_doc_visible' => ['name' => 'editor_doc_visible', 'type' => 'bool', 'internal' => 'isVisible'], 'editor_doc_visible' => ['name' => 'editor_doc_visible', 'type' => 'bool', 'internal' => 'isVisible'],
]; ];
/** /**
@ -56,8 +56,8 @@ final class EditorDocMapper extends DataMapperAbstract
*/ */
protected static array $belongsTo = [ protected static array $belongsTo = [
'createdBy' => [ 'createdBy' => [
'mapper' => AccountMapper::class, 'mapper' => AccountMapper::class,
'external' => 'editor_doc_created_by', 'external' => 'editor_doc_created_by',
], ],
]; ];
@ -69,8 +69,8 @@ final class EditorDocMapper extends DataMapperAbstract
*/ */
protected static array $ownsOne = [ protected static array $ownsOne = [
'type' => [ 'type' => [
'mapper' => EdutirDocTypeMapper::class, 'mapper' => EditorDocTypeMapper::class,
'external' => 'editor_doc_type', 'external' => 'editor_doc_type',
], ],
]; ];

View File

@ -33,10 +33,10 @@ final class EditorDocTypeL11nMapper extends DataMapperAbstract
* @since 1.0.0 * @since 1.0.0
*/ */
protected static array $columns = [ protected static array $columns = [
'editor_doc_type_l11n_id' => ['name' => 'editor_doc_type_l11n_id', 'type' => 'int', 'internal' => 'id'], 'editor_doc_type_l11n_id' => ['name' => 'editor_doc_type_l11n_id', 'type' => 'int', 'internal' => 'id'],
'editor_doc_type_l11n_title' => ['name' => 'editor_doc_type_l11n_title', 'type' => 'string', 'internal' => 'title', 'autocomplete' => true], 'editor_doc_type_l11n_title' => ['name' => 'editor_doc_type_l11n_title', 'type' => 'string', 'internal' => 'title', 'autocomplete' => true],
'editor_doc_type_l11n_type' => ['name' => 'editor_doc_type_l11n_type', 'type' => 'int', 'internal' => 'type'], 'editor_doc_type_l11n_type' => ['name' => 'editor_doc_type_l11n_type', 'type' => 'int', 'internal' => 'type'],
'editor_doc_type_l11n_language' => ['name' => 'editor_doc_type_l11n_language', 'type' => 'string', 'internal' => 'language'], 'editor_doc_type_l11n_language' => ['name' => 'editor_doc_type_l11n_language', 'type' => 'string', 'internal' => 'language'],
]; ];
/** /**

View File

@ -33,8 +33,8 @@ final class EditorDocTypeMapper extends DataMapperAbstract
* @since 1.0.0 * @since 1.0.0
*/ */
protected static array $columns = [ protected static array $columns = [
'editor_doc_type_id' => ['name' => 'editor_doc_type_id', 'type' => 'int', 'internal' => 'id'], 'editor_doc_type_id' => ['name' => 'editor_doc_type_id', 'type' => 'int', 'internal' => 'id'],
'editor_doc_type_name' => ['name' => 'editor_doc_type_name', 'type' => 'string', 'internal' => 'name'], 'editor_doc_type_name' => ['name' => 'editor_doc_type_name', 'type' => 'string', 'internal' => 'name'],
]; ];
/** /**
@ -45,12 +45,12 @@ final class EditorDocTypeMapper extends DataMapperAbstract
*/ */
protected static array $hasMany = [ protected static array $hasMany = [
'title' => [ 'title' => [
'mapper' => EditorDocTypeL11nMapper::class, 'mapper' => EditorDocTypeL11nMapper::class,
'table' => 'editor_doc_type_l11n', 'table' => 'editor_doc_type_l11n',
'self' => 'editor_doc_type_l11n_type', 'self' => 'editor_doc_type_l11n_type',
'column' => 'title', 'column' => 'title',
'conditional' => true, 'conditional' => true,
'external' => null, 'external' => null,
], ],
]; ];

View File

@ -0,0 +1,39 @@
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\Editor\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\Editor\Models;
/**
* Null model
*
* @package Modules\Editor\Models
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
final class NullEditorDocType extends EditorDocType
{
/**
* Constructor
*
* @param int $id Model id
*
* @since 1.0.0
*/
public function __construct(int $id = 0)
{
$this->id = $id;
parent::__construct();
}
}

View File

@ -0,0 +1,39 @@
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\Editor\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\Editor\Models;
/**
* Null model
*
* @package Modules\Editor\Models
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
final class NullEditorDocTypeL11n extends EditorDocTypeL11n
{
/**
* Constructor
*
* @param int $id Model id
*
* @since 1.0.0
*/
public function __construct(int $id = 0)
{
$this->id = $id;
parent::__construct();
}
}