<?php

declare(strict_types=1);

namespace Medienreaktor\Courses\Controller;


/**
 * This file is part of the "Courses" 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 Matthias Schieber <matthias.schieber@medienreaktor.de>, Medienreaktor
 */

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

    /**
     * workshopRepository
     *
     * @var \Medienreaktor\Courses\Domain\Repository\WorkshopRepository
     */
    protected $workshopRepository = null;
    public function __construct(\Medienreaktor\Courses\Domain\Repository\WorkshopRepository $workshopRepository)
    {
        $this->workshopRepository = $workshopRepository;
    }

    /**
     * action list
     *
     * @return string|object|null|void
     */
    public function listAction(): \Psr\Http\Message\ResponseInterface
    {
        $workshops = $this->workshopRepository->findAll();
        $this->view->assign('workshops', $workshops);
        return $this->htmlResponse();
    }

    /**
     * action highlight
     *
     * @return string|object|null|void
     */
    public function highlightAction(): \Psr\Http\Message\ResponseInterface
    {
        return $this->htmlResponse();
    }
}
