2018-05-26 20:46:55 +02:00
|
|
|
<?php
|
2019-12-07 12:13:32 +01:00
|
|
|
|
2019-08-12 17:25:59 +02:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2019-12-01 12:16:06 +01:00
|
|
|
namespace TTN\Tea\Controller;
|
2018-05-26 20:46:55 +02:00
|
|
|
|
2019-12-01 12:16:06 +01:00
|
|
|
use TTN\Tea\Domain\Model\Product\Tea;
|
|
|
|
use TTN\Tea\Domain\Repository\Product\TeaRepository;
|
2018-05-26 20:46:55 +02:00
|
|
|
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;
|
|
|
|
|
2019-08-12 17:25:59 +02:00
|
|
|
public function injectTeaRepository(TeaRepository $teaRepository): void
|
2018-05-26 20:46:55 +02:00
|
|
|
{
|
|
|
|
$this->teaRepository = $teaRepository;
|
|
|
|
}
|
|
|
|
|
2019-08-12 17:25:59 +02:00
|
|
|
public function indexAction(): void
|
2018-05-26 20:46:55 +02:00
|
|
|
{
|
|
|
|
$this->view->assign('teas', $this->teaRepository->findAll());
|
|
|
|
}
|
2018-05-28 17:05:39 +02:00
|
|
|
|
2019-08-12 17:25:59 +02:00
|
|
|
public function showAction(Tea $tea): void
|
2018-05-28 17:05:39 +02:00
|
|
|
{
|
|
|
|
$this->view->assign('tea', $tea);
|
|
|
|
}
|
2018-05-26 20:46:55 +02:00
|
|
|
}
|