<?php
namespace App\Controller;

use Symfony\Component\HttpFoundation\Response;
use App\Repository\ActivityRepository;
use App\Entity\ActivityEntity;

/**
 * Controller for activity related pages
 */
class ActivityController extends AbstractExtendedController
{

    /**
     * Page for the list of activities
     *
     * @return Response
     */
    public function activities(): Response
    {
        // Get repositories
        $entityManager = $this->getDoctrine()->getManager();
        /** @var ActivityRepository $actorRepository */
        $activityRepository = $entityManager->getRepository(ActivityEntity::class);

        $activities = $activityRepository->findAll();

        return $this->render('activity/activities.html.twig', [
            'activities' => $activities,
        ]);
    }
}