diff --git a/Admin/Install/db.json b/Admin/Install/db.json index 1368770..8004a7c 100755 --- a/Admin/Install/db.json +++ b/Admin/Install/db.json @@ -58,6 +58,13 @@ "primary": 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": { "name": "editor_doc_title", "type": "VARCHAR(255)", diff --git a/Models/EditorDocMapper.php b/Models/EditorDocMapper.php index 32285d8..5195f29 100755 --- a/Models/EditorDocMapper.php +++ b/Models/EditorDocMapper.php @@ -37,15 +37,15 @@ final class EditorDocMapper extends DataMapperAbstract * @since 1.0.0 */ protected static array $columns = [ - '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_title' => ['name' => 'editor_doc_title', 'type' => 'string', 'internal' => 'title'], - 'editor_doc_plain' => ['name' => 'editor_doc_plain', 'type' => 'string', 'internal' => 'plain'], - 'editor_doc_content' => ['name' => 'editor_doc_content', 'type' => 'string', 'internal' => 'content'], - 'editor_doc_type' => ['name' => 'editor_doc_type', 'type' => 'int', 'internal' => 'type'], - '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_visible' => ['name' => 'editor_doc_visible', 'type' => 'bool', 'internal' => 'isVisible'], + '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_title' => ['name' => 'editor_doc_title', 'type' => 'string', 'internal' => 'title'], + 'editor_doc_plain' => ['name' => 'editor_doc_plain', 'type' => 'string', 'internal' => 'plain'], + 'editor_doc_content' => ['name' => 'editor_doc_content', 'type' => 'string', 'internal' => 'content'], + 'editor_doc_type' => ['name' => 'editor_doc_type', 'type' => 'int', 'internal' => 'type'], + '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_visible' => ['name' => 'editor_doc_visible', 'type' => 'bool', 'internal' => 'isVisible'], ]; /** @@ -56,8 +56,8 @@ final class EditorDocMapper extends DataMapperAbstract */ protected static array $belongsTo = [ 'createdBy' => [ - 'mapper' => AccountMapper::class, - 'external' => 'editor_doc_created_by', + 'mapper' => AccountMapper::class, + 'external' => 'editor_doc_created_by', ], ]; @@ -69,8 +69,8 @@ final class EditorDocMapper extends DataMapperAbstract */ protected static array $ownsOne = [ 'type' => [ - 'mapper' => EdutirDocTypeMapper::class, - 'external' => 'editor_doc_type', + 'mapper' => EditorDocTypeMapper::class, + 'external' => 'editor_doc_type', ], ]; diff --git a/Models/EditorDocTypeL11nMapper.php b/Models/EditorDocTypeL11nMapper.php index 4b99ad5..bd37889 100644 --- a/Models/EditorDocTypeL11nMapper.php +++ b/Models/EditorDocTypeL11nMapper.php @@ -33,10 +33,10 @@ final class EditorDocTypeL11nMapper extends DataMapperAbstract * @since 1.0.0 */ protected static array $columns = [ - '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_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_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_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'], ]; /** diff --git a/Models/EditorDocTypeMapper.php b/Models/EditorDocTypeMapper.php index 33ed270..02a7168 100644 --- a/Models/EditorDocTypeMapper.php +++ b/Models/EditorDocTypeMapper.php @@ -33,8 +33,8 @@ final class EditorDocTypeMapper extends DataMapperAbstract * @since 1.0.0 */ protected static array $columns = [ - '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_id' => ['name' => 'editor_doc_type_id', 'type' => 'int', 'internal' => 'id'], + '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 = [ 'title' => [ - 'mapper' => EditorDocTypeL11nMapper::class, - 'table' => 'editor_doc_type_l11n', - 'self' => 'editor_doc_type_l11n_type', - 'column' => 'title', - 'conditional' => true, - 'external' => null, + 'mapper' => EditorDocTypeL11nMapper::class, + 'table' => 'editor_doc_type_l11n', + 'self' => 'editor_doc_type_l11n_type', + 'column' => 'title', + 'conditional' => true, + 'external' => null, ], ]; diff --git a/Models/NullEditorDocType.php b/Models/NullEditorDocType.php new file mode 100644 index 0000000..a250297 --- /dev/null +++ b/Models/NullEditorDocType.php @@ -0,0 +1,39 @@ +id = $id; + parent::__construct(); + } +} diff --git a/Models/NullEditorDocTypeL11n.php b/Models/NullEditorDocTypeL11n.php new file mode 100644 index 0000000..b272fb0 --- /dev/null +++ b/Models/NullEditorDocTypeL11n.php @@ -0,0 +1,39 @@ +id = $id; + parent::__construct(); + } +}