Your IP : 216.73.216.52


Current Path : /proc/thread-self/root/var/www/surf/TYPO3/src/surf/Classes/Controller/
Upload File :
Current File : //proc/thread-self/root/var/www/surf/TYPO3/src/surf/Classes/Controller/LogController.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 
 */

/**
 * LogController
 */
class LogController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
{

    /**
     * logRepository
     *
     * @var \Torresani\Surf\Domain\Repository\LogRepository
     */
    protected $logRepository = null;

    /**
     * @param \Torresani\Surf\Domain\Repository\LogRepository $logRepository
     */
    public function injectLogRepository(\Torresani\Surf\Domain\Repository\LogRepository $logRepository)
    {
        $this->logRepository = $logRepository;
    }

    /**
     * action list
     *
     * @return \Psr\Http\Message\ResponseInterface
     */
    public function listAction(): \Psr\Http\Message\ResponseInterface
    {
        $logs = $this->logRepository->findAll();
        $this->view->assign('logs', $logs);
        return $this->htmlResponse();
    }

    /**
     * action show
     *
     * @param \Torresani\Surf\Domain\Model\Log $log
     * @return \Psr\Http\Message\ResponseInterface
     */
    public function showAction(\Torresani\Surf\Domain\Model\Log $log): \Psr\Http\Message\ResponseInterface
    {
        $this->view->assign('log', $log);
        return $this->htmlResponse();
    }
}