| 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/VendorController.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>
*/
/**
* VendorController
*/
class VendorController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
{
/**
* vendorRepository
*
* @var \Torresani\Surf\Domain\Repository\VendorRepository
*/
protected $vendorRepository = null;
/**
* @param \Torresani\Surf\Domain\Repository\VendorRepository $vendorRepository
*/
public function injectVendorRepository(\Torresani\Surf\Domain\Repository\VendorRepository $vendorRepository)
{
$this->vendorRepository = $vendorRepository;
}
/**
* action list
*
* @return \Psr\Http\Message\ResponseInterface
*/
public function listAction(): \Psr\Http\Message\ResponseInterface
{
$vendors = $this->vendorRepository->findAll();
$this->view->assign('vendors', $vendors);
return $this->htmlResponse();
}
/**
* action show
*
* @param \Torresani\Surf\Domain\Model\Vendor $vendor
* @return \Psr\Http\Message\ResponseInterface
*/
public function showAction(\Torresani\Surf\Domain\Model\Vendor $vendor): \Psr\Http\Message\ResponseInterface
{
$this->view->assign('vendor', $vendor);
return $this->htmlResponse();
}
}