mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2024-11-23 04:36:13 +01:00
tea/Classes/Controller/TeaController.php
Oliver Klee 3401e32a84
[FEATURE] Add PHP-CS-Fixer (#53)
Also run the fixer on all classes and tests.
2019-08-12 17:25:59 +02:00

36 lines
824 B
PHP

<?php
declare(strict_types=1);
namespace OliverKlee\Tea\Controller;
use OliverKlee\Tea\Domain\Model\Product\Tea;
use OliverKlee\Tea\Domain\Repository\Product\TeaRepository;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
/**
* Controller for the main "Tea" FE plugin.
*
* @author Oliver Klee <typo3-coding@oliverklee.de
*/
class TeaController extends ActionController
{
/**
* @var TeaRepository
*/
private $teaRepository = null;
public function injectTeaRepository(TeaRepository $teaRepository): void
{
$this->teaRepository = $teaRepository;
}
public function indexAction(): void
{
$this->view->assign('teas', $this->teaRepository->findAll());
}
public function showAction(Tea $tea): void
{
$this->view->assign('tea', $tea);
}
}