Continue with getter/setter cleanup

This commit is contained in:
Dennis Eichhorn 2023-05-30 15:44:20 +02:00
parent c2bea7815f
commit bc1143dd20
6 changed files with 17 additions and 17 deletions

View File

@ -52,7 +52,7 @@ final class BackendController extends Controller
public function setupStyles(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
{
/** @var \phpOMS\Model\Html\Head $head */
$head = $response->get('Content')->getData('head');
$head = $response->get('Content')->head;
$head->addAsset(AssetType::CSS, '/Modules/Kanban/Theme/Backend/css/styles.css?v=1.0.0');
}
@ -73,7 +73,7 @@ final class BackendController extends Controller
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/Kanban/Theme/Backend/kanban-dashboard');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1005801001, $request, $response));
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005801001, $request, $response);
$list = KanbanBoardMapper::getAll()
->with('tags')
@ -83,7 +83,7 @@ final class BackendController extends Controller
->limit(20)
->execute();
$view->setData('boards', $list);
$view->data['boards'] = $list;
return $view;
}
@ -127,9 +127,9 @@ final class BackendController extends Controller
}
$view->setTemplate('/Modules/Kanban/Theme/Backend/kanban-board');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1005801001, $request, $response));
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005801001, $request, $response);
$view->setData('board', $board);
$view->data['board'] = $board;
return $view;
}
@ -150,7 +150,7 @@ final class BackendController extends Controller
{
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/Kanban/Theme/Backend/kanban-archive');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1005801001, $request, $response));
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005801001, $request, $response);
$list = KanbanBoardMapper::getAll()
->with('tags')
@ -160,7 +160,7 @@ final class BackendController extends Controller
->limit(25)
->execute();
$view->setData('boards', $list);
$view->data['boards'] = $list;
return $view;
}
@ -192,7 +192,7 @@ final class BackendController extends Controller
}
$view->setTemplate('/Modules/Kanban/Theme/Backend/kanban-board-create');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1005801001, $request, $response));
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005801001, $request, $response);
return $view;
}
@ -238,8 +238,8 @@ final class BackendController extends Controller
}
$view->setTemplate('/Modules/Kanban/Theme/Backend/kanban-card');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1005801001, $request, $response));
$view->setData('card', $card);
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005801001, $request, $response);
$view->data['card'] = $card;
return $view;
}

View File

@ -16,12 +16,12 @@ use phpOMS\Uri\UriFactory;
/** @var \phpOMS\Views\View $this */
/** @var \Modules\News\Models\NewsArticle[] $boards */
$boards = $this->getData('boards') ?? [];
$boards = $this->data['boards'] ?? [];
$previous = empty($boards) ? 'kanban/archive' : 'kanban/archive?{?}&id=' . \reset($boards)->id . '&ptype=p';
$next = empty($boards) ? 'kanban/archive' : 'kanban/archive?{?}&id=' . \end($boards)->id . '&ptype=n';
echo $this->getData('nav')->render(); ?>
echo $this->data['nav']->render(); ?>
<div class="row">
<div class="col-xs-12">

View File

@ -11,4 +11,4 @@
* @link https://jingga.app
*/
declare(strict_types=1);
echo $this->getData('nav')->render();
echo $this->data['nav']->render();

View File

@ -13,7 +13,7 @@
declare(strict_types=1);
/** @var \Modules\Kanban\Models\KanbanBoard $board */
$board = $this->getData('board');
$board = $this->data['board'];
/** @var \Modules\Kanban\Models\KanbanColumn[] $columns */
$columns = $board->getColumns();

View File

@ -15,7 +15,7 @@ declare(strict_types=1);
use phpOMS\Uri\UriFactory;
/** @var \Modules\Kanban\Models\KanbanCard $card */
$card = $this->getData('card');
$card = $this->data['card'];
$comments = $card->getComments();
?>

View File

@ -15,12 +15,12 @@ declare(strict_types=1);
use phpOMS\Uri\UriFactory;
/** @var \Modules\Kanban\Models\KanbanBoard[] $boards */
$boards = $this->getData('boards');
$boards = $this->data['boards'];
$previous = empty($boards) ? 'kanban/dashboard' : 'kanban/dashboard?{?}&id=' . \reset($boards)->id . '&ptype=p';
$next = empty($boards) ? 'kanban/dashboard' : 'kanban/dashboard?{?}&id=' . \end($boards)->id . '&ptype=n';
echo $this->getData('nav')->render(); ?>
echo $this->data['nav']->render(); ?>
<div class="row">
<?php if (empty($boards)) : ?>