bug fixes / dbmapper fixes

This commit is contained in:
Dennis Eichhorn 2021-12-19 20:20:39 +01:00
parent 6b42f1394f
commit 67ecfeffca
6 changed files with 60 additions and 49 deletions

View File

@ -18,7 +18,6 @@ use Modules\Kanban\Models\KanbanBoardMapper;
use Modules\Kanban\Models\KanbanCardMapper;
use Modules\Kanban\Models\PermissionState;
use phpOMS\Account\PermissionType;
use phpOMS\Algorithm\Sort\SortOrder;
use phpOMS\Asset\AssetType;
use phpOMS\Contract\RenderableInterface;
use phpOMS\DataStorage\Database\Query\OrderType;
@ -105,7 +104,7 @@ final class BackendController extends Controller
{
$view = new View($this->app->l11nManager, $request, $response);
$board = KanbanBoardMapper::get()
$board = KanbanBoardMapper::get()
->with('columns')
->with('columns/cards')
->with('columns/cards/tags')

View File

@ -35,15 +35,15 @@ final class KanbanBoardMapper extends DataMapperFactory
* @since 1.0.0
*/
public const COLUMNS = [
'kanban_board_id' => ['name' => 'kanban_board_id', 'type' => 'int', 'internal' => 'id'],
'kanban_board_name' => ['name' => 'kanban_board_name', 'type' => 'string', 'internal' => 'name'],
'kanban_board_desc' => ['name' => 'kanban_board_desc', 'type' => 'string', 'internal' => 'description'],
'kanban_board_descraw' => ['name' => 'kanban_board_descraw', 'type' => 'string', 'internal' => 'descriptionRaw'],
'kanban_board_status' => ['name' => 'kanban_board_status', 'type' => 'int', 'internal' => 'status'],
'kanban_board_order' => ['name' => 'kanban_board_order', 'type' => 'int', 'internal' => 'order'],
'kanban_board_style' => ['name' => 'kanban_board_style', 'type' => 'string', 'internal' => 'style'],
'kanban_board_created_by' => ['name' => 'kanban_board_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true],
'kanban_board_created_at' => ['name' => 'kanban_board_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
'kanban_board_id' => ['name' => 'kanban_board_id', 'type' => 'int', 'internal' => 'id'],
'kanban_board_name' => ['name' => 'kanban_board_name', 'type' => 'string', 'internal' => 'name'],
'kanban_board_desc' => ['name' => 'kanban_board_desc', 'type' => 'string', 'internal' => 'description'],
'kanban_board_descraw' => ['name' => 'kanban_board_descraw', 'type' => 'string', 'internal' => 'descriptionRaw'],
'kanban_board_status' => ['name' => 'kanban_board_status', 'type' => 'int', 'internal' => 'status'],
'kanban_board_order' => ['name' => 'kanban_board_order', 'type' => 'int', 'internal' => 'order'],
'kanban_board_style' => ['name' => 'kanban_board_style', 'type' => 'string', 'internal' => 'style'],
'kanban_board_created_by' => ['name' => 'kanban_board_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true],
'kanban_board_created_at' => ['name' => 'kanban_board_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
];
/**
@ -54,10 +54,10 @@ final class KanbanBoardMapper extends DataMapperFactory
*/
public const HAS_MANY = [
'columns' => [
'mapper' => KanbanColumnMapper::class,
'table' => 'kanban_column',
'self' => 'kanban_column_board',
'external' => null,
'mapper' => KanbanColumnMapper::class,
'table' => 'kanban_column',
'self' => 'kanban_column_board',
'external' => null,
],
'tags' => [
'mapper' => TagMapper::class,
@ -75,8 +75,8 @@ final class KanbanBoardMapper extends DataMapperFactory
*/
public const BELONGS_TO = [
'createdBy' => [
'mapper' => AccountMapper::class,
'external' => 'kanban_board_created_by',
'mapper' => AccountMapper::class,
'external' => 'kanban_board_created_by',
],
];

View File

@ -35,12 +35,12 @@ final class KanbanCardCommentMapper extends DataMapperFactory
* @since 1.0.0
*/
public const COLUMNS = [
'kanban_card_comment_id' => ['name' => 'kanban_card_comment_id', 'type' => 'int', 'internal' => 'id'],
'kanban_card_comment_description' => ['name' => 'kanban_card_comment_description', 'type' => 'string', 'internal' => 'description'],
'kanban_card_comment_descriptionraw' => ['name' => 'kanban_card_comment_descriptionraw', 'type' => 'string', 'internal' => 'descriptionRaw'],
'kanban_card_comment_card' => ['name' => 'kanban_card_comment_card', 'type' => 'int', 'internal' => 'card'],
'kanban_card_comment_created_at' => ['name' => 'kanban_card_comment_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
'kanban_card_comment_created_by' => ['name' => 'kanban_card_comment_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true],
'kanban_card_comment_id' => ['name' => 'kanban_card_comment_id', 'type' => 'int', 'internal' => 'id'],
'kanban_card_comment_description' => ['name' => 'kanban_card_comment_description', 'type' => 'string', 'internal' => 'description'],
'kanban_card_comment_descriptionraw' => ['name' => 'kanban_card_comment_descriptionraw', 'type' => 'string', 'internal' => 'descriptionRaw'],
'kanban_card_comment_card' => ['name' => 'kanban_card_comment_card', 'type' => 'int', 'internal' => 'card'],
'kanban_card_comment_created_at' => ['name' => 'kanban_card_comment_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
'kanban_card_comment_created_by' => ['name' => 'kanban_card_comment_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true],
];
/**
@ -66,8 +66,8 @@ final class KanbanCardCommentMapper extends DataMapperFactory
*/
public const BELONGS_TO = [
'createdBy' => [
'mapper' => AccountMapper::class,
'external' => 'kanban_card_comment_created_by',
'mapper' => AccountMapper::class,
'external' => 'kanban_card_comment_created_by',
],
];

View File

@ -36,19 +36,19 @@ final class KanbanCardMapper extends DataMapperFactory
* @since 1.0.0
*/
public const COLUMNS = [
'kanban_card_id' => ['name' => 'kanban_card_id', 'type' => 'int', 'internal' => 'id'],
'kanban_card_name' => ['name' => 'kanban_card_name', 'type' => 'string', 'internal' => 'name'],
'kanban_card_description' => ['name' => 'kanban_card_description', 'type' => 'string', 'internal' => 'description'],
'kanban_card_descriptionraw' => ['name' => 'kanban_card_descriptionraw', 'type' => 'string', 'internal' => 'descriptionRaw'],
'kanban_card_style' => ['name' => 'kanban_card_style', 'type' => 'string', 'internal' => 'style'],
'kanban_card_type' => ['name' => 'kanban_card_type', 'type' => 'int', 'internal' => 'type'],
'kanban_card_status' => ['name' => 'kanban_card_status', 'type' => 'int', 'internal' => 'status'],
'kanban_card_order' => ['name' => 'kanban_card_order', 'type' => 'int', 'internal' => 'order'],
'kanban_card_color' => ['name' => 'kanban_card_color', 'type' => 'string', 'internal' => 'color'],
'kanban_card_ref' => ['name' => 'kanban_card_ref', 'type' => 'int', 'internal' => 'ref'],
'kanban_card_column' => ['name' => 'kanban_card_column', 'type' => 'int', 'internal' => 'column'],
'kanban_card_created_at' => ['name' => 'kanban_card_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
'kanban_card_created_by' => ['name' => 'kanban_card_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true],
'kanban_card_id' => ['name' => 'kanban_card_id', 'type' => 'int', 'internal' => 'id'],
'kanban_card_name' => ['name' => 'kanban_card_name', 'type' => 'string', 'internal' => 'name'],
'kanban_card_description' => ['name' => 'kanban_card_description', 'type' => 'string', 'internal' => 'description'],
'kanban_card_descriptionraw' => ['name' => 'kanban_card_descriptionraw', 'type' => 'string', 'internal' => 'descriptionRaw'],
'kanban_card_style' => ['name' => 'kanban_card_style', 'type' => 'string', 'internal' => 'style'],
'kanban_card_type' => ['name' => 'kanban_card_type', 'type' => 'int', 'internal' => 'type'],
'kanban_card_status' => ['name' => 'kanban_card_status', 'type' => 'int', 'internal' => 'status'],
'kanban_card_order' => ['name' => 'kanban_card_order', 'type' => 'int', 'internal' => 'order'],
'kanban_card_color' => ['name' => 'kanban_card_color', 'type' => 'string', 'internal' => 'color'],
'kanban_card_ref' => ['name' => 'kanban_card_ref', 'type' => 'int', 'internal' => 'ref'],
'kanban_card_column' => ['name' => 'kanban_card_column', 'type' => 'int', 'internal' => 'column'],
'kanban_card_created_at' => ['name' => 'kanban_card_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
'kanban_card_created_by' => ['name' => 'kanban_card_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true],
];
/**
@ -59,8 +59,8 @@ final class KanbanCardMapper extends DataMapperFactory
*/
public const BELONGS_TO = [
'createdBy' => [
'mapper' => AccountMapper::class,
'external' => 'kanban_card_created_by',
'mapper' => AccountMapper::class,
'external' => 'kanban_card_created_by',
],
];
@ -78,10 +78,10 @@ final class KanbanCardMapper extends DataMapperFactory
'self' => 'kanban_card_media_src',
],
'comments' => [
'mapper' => KanbanCardCommentMapper::class,
'table' => 'kanban_card_comment',
'self' => 'kanban_card_comment_card',
'external' => null,
'mapper' => KanbanCardCommentMapper::class,
'table' => 'kanban_card_comment',
'self' => 'kanban_card_comment_card',
'external' => null,
],
'tags' => [
'mapper' => TagMapper::class,

View File

@ -47,10 +47,10 @@ final class KanbanColumnMapper extends DataMapperFactory
*/
public const HAS_MANY = [
'cards' => [
'mapper' => KanbanCardMapper::class,
'table' => 'kanban_card',
'self' => 'kanban_card_column',
'external' => null,
'mapper' => KanbanCardMapper::class,
'table' => 'kanban_card',
'self' => 'kanban_card_column',
'external' => null,
],
];

View File

@ -1,2 +1,14 @@
<?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);
echo $this->getData('nav')->render();