bug fixes / dbmapper fixes

This commit is contained in:
Dennis Eichhorn 2021-12-19 20:20:39 +01:00
parent 049d585be1
commit 0e5bcbbb11
5 changed files with 52 additions and 28 deletions

View File

@ -33,11 +33,11 @@ final class CommentListMapper extends DataMapperFactory
* @since 1.0.0
*/
public const COLUMNS = [
'comments_list_id' => ['name' => 'comments_list_id', 'type' => 'int', 'internal' => 'id'],
'comments_list_status' => ['name' => 'comments_list_status', 'type' => 'int', 'internal' => 'status'],
'comments_list_allow_voting' => ['name' => 'comments_list_allow_voting', 'type' => 'bool', 'internal' => 'allowVoting'],
'comments_list_allow_edit' => ['name' => 'comments_list_allow_edit', 'type' => 'bool', 'internal' => 'allowEdit'],
'comments_list_allow_files' => ['name' => 'comments_list_allow_files', 'type' => 'bool', 'internal' => 'allowFiles'],
'comments_list_id' => ['name' => 'comments_list_id', 'type' => 'int', 'internal' => 'id'],
'comments_list_status' => ['name' => 'comments_list_status', 'type' => 'int', 'internal' => 'status'],
'comments_list_allow_voting' => ['name' => 'comments_list_allow_voting', 'type' => 'bool', 'internal' => 'allowVoting'],
'comments_list_allow_edit' => ['name' => 'comments_list_allow_edit', 'type' => 'bool', 'internal' => 'allowEdit'],
'comments_list_allow_files' => ['name' => 'comments_list_allow_files', 'type' => 'bool', 'internal' => 'allowFiles'],
];
/**
@ -48,10 +48,10 @@ final class CommentListMapper extends DataMapperFactory
*/
public const HAS_MANY = [
'comments' => [
'mapper' => CommentMapper::class,
'table' => 'comments_comment',
'self' => 'comments_comment_list',
'external' => null,
'mapper' => CommentMapper::class,
'table' => 'comments_comment',
'self' => 'comments_comment_list',
'external' => null,
],
];

View File

@ -35,14 +35,14 @@ final class CommentMapper extends DataMapperFactory
* @since 1.0.0
*/
public const COLUMNS = [
'comments_comment_id' => ['name' => 'comments_comment_id', 'type' => 'int', 'internal' => 'id'],
'comments_comment_title' => ['name' => 'comments_comment_title', 'type' => 'string', 'internal' => 'title'],
'comments_comment_status' => ['name' => 'comments_comment_status', 'type' => 'int', 'internal' => 'status'],
'comments_comment_content' => ['name' => 'comments_comment_content', 'type' => 'string', 'internal' => 'content'],
'comments_comment_content_raw' => ['name' => 'comments_comment_content_raw', 'type' => 'string', 'internal' => 'contentRaw'],
'comments_comment_list' => ['name' => 'comments_comment_list', 'type' => 'int', 'internal' => 'list'],
'comments_comment_ref' => ['name' => 'comments_comment_ref', 'type' => 'int', 'internal' => 'ref'],
'comments_comment_created_by' => ['name' => 'comments_comment_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true],
'comments_comment_id' => ['name' => 'comments_comment_id', 'type' => 'int', 'internal' => 'id'],
'comments_comment_title' => ['name' => 'comments_comment_title', 'type' => 'string', 'internal' => 'title'],
'comments_comment_status' => ['name' => 'comments_comment_status', 'type' => 'int', 'internal' => 'status'],
'comments_comment_content' => ['name' => 'comments_comment_content', 'type' => 'string', 'internal' => 'content'],
'comments_comment_content_raw' => ['name' => 'comments_comment_content_raw', 'type' => 'string', 'internal' => 'contentRaw'],
'comments_comment_list' => ['name' => 'comments_comment_list', 'type' => 'int', 'internal' => 'list'],
'comments_comment_ref' => ['name' => 'comments_comment_ref', 'type' => 'int', 'internal' => 'ref'],
'comments_comment_created_by' => ['name' => 'comments_comment_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true],
'comments_comment_created_at' => ['name' => 'comments_comment_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
];
@ -54,12 +54,12 @@ final class CommentMapper extends DataMapperFactory
*/
public const BELONGS_TO = [
'createdBy' => [
'mapper' => AccountMapper::class,
'external' => 'comments_comment_created_by',
'mapper' => AccountMapper::class,
'external' => 'comments_comment_created_by',
],
'list' => [
'mapper' => CommentListMapper::class,
'external' => 'comments_comment_list',
'mapper' => CommentListMapper::class,
'external' => 'comments_comment_list',
],
];

View File

@ -33,11 +33,11 @@ final class CommentVoteMapper extends DataMapperFactory
* @since 1.0.0
*/
public const COLUMNS = [
'comments_comment_vote_id' => ['name' => 'comments_comment_vote_id', 'type' => 'int', 'internal' => 'id'],
'comments_comment_vote_score' => ['name' => 'comments_comment_vote_score', 'type' => 'int', 'internal' => 'score'],
'comments_comment_vote_comment' => ['name' => 'comments_comment_vote_comment', 'type' => 'int', 'internal' => 'comment', 'readonly' => true],
'comments_comment_vote_created_by' => ['name' => 'comments_comment_vote_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true],
'comments_comment_vote_created_at' => ['name' => 'comments_comment_vote_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
'comments_comment_vote_id' => ['name' => 'comments_comment_vote_id', 'type' => 'int', 'internal' => 'id'],
'comments_comment_vote_score' => ['name' => 'comments_comment_vote_score', 'type' => 'int', 'internal' => 'score'],
'comments_comment_vote_comment' => ['name' => 'comments_comment_vote_comment', 'type' => 'int', 'internal' => 'comment', 'readonly' => true],
'comments_comment_vote_created_by' => ['name' => 'comments_comment_vote_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true],
'comments_comment_vote_created_at' => ['name' => 'comments_comment_vote_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
];
/**

View File

@ -1,4 +1,16 @@
<?php declare(strict_types=1);
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Template
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
use phpOMS\Uri\UriFactory;

View File

@ -1,4 +1,16 @@
<?php declare(strict_types=1);
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Template
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
use Modules\Comments\Models\CommentListStatus;
use phpOMS\Uri\UriFactory;