| Current Path : /proc/thread-self/root/var/www/surf/TYPO3/src/surf/Classes/Controller/ |
| Current File : //proc/thread-self/root/var/www/surf/TYPO3/src/surf/Classes/Controller/StoreController.php |
<?php
declare(strict_types=1);
namespace Torresani\Surf\Controller;
/**
* This file is part of the "Surf" Extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* (c) 2023 Roberto Torresani <roberto@torresani.eu>
*/
/**
* StoreController
*/
class StoreController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
{
/**
* storeRepository
*
* @var \Torresani\Surf\Domain\Repository\StoreRepository
*/
protected $storeRepository = null;
/**
* @param \Torresani\Surf\Domain\Repository\StoreRepository $storeRepository
*/
public function injectStoreRepository(\Torresani\Surf\Domain\Repository\StoreRepository $storeRepository)
{
$this->storeRepository = $storeRepository;
}
/**
* action list
*
* @return \Psr\Http\Message\ResponseInterface
*/
public function listAction(): \Psr\Http\Message\ResponseInterface
{
$stores = $this->storeRepository->findAll();
$this->view->assign('stores', $stores);
return $this->htmlResponse();
}
/**
* action show
*
* @param \Torresani\Surf\Domain\Model\Store $store
* @return \Psr\Http\Message\ResponseInterface
*/
public function showAction(\Torresani\Surf\Domain\Model\Store $store): \Psr\Http\Message\ResponseInterface
{
$this->view->assign('store', $store);
return $this->htmlResponse();
}
}