Deprecated: Symfony\Component\Translation\t(): Implicitly marking parameter $domain as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/t/taurushr/vendor/symfony/translation/Resources/functions.php on line 18

Deprecated: Symfony\Component\Dotenv\Dotenv::loadEnv(): Implicitly marking parameter $envKey as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/t/taurushr/vendor/symfony/dotenv/Dotenv.php on line 110

Deprecated: Symfony\Component\Runtime\GenericRuntime::getResolver(): Implicitly marking parameter $reflector as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/t/taurushr/vendor/symfony/runtime/GenericRuntime.php on line 89

Deprecated: Symfony\Component\Runtime\RuntimeInterface::getResolver(): Implicitly marking parameter $reflector as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/t/taurushr/vendor/symfony/runtime/RuntimeInterface.php on line 26

Deprecated: Symfony\Component\Console\Input\ArgvInput::__construct(): Implicitly marking parameter $argv as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/t/taurushr/vendor/symfony/console/Input/ArgvInput.php on line 46

Deprecated: Symfony\Component\Console\Input\ArgvInput::__construct(): Implicitly marking parameter $definition as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/t/taurushr/vendor/symfony/console/Input/ArgvInput.php on line 46

Deprecated: Symfony\Component\Console\Input\Input::__construct(): Implicitly marking parameter $definition as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/t/taurushr/vendor/symfony/console/Input/Input.php on line 36

Deprecated: Constant E_STRICT is deprecated in /var/www/html/t/taurushr/vendor/symfony/error-handler/ErrorHandler.php on line 58

Deprecated: Constant E_STRICT is deprecated in /var/www/html/t/taurushr/vendor/symfony/error-handler/ErrorHandler.php on line 76
Symfony Profiler

src/Controller/TestimonialDefaultController.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Annotation\CmsComponent;
  4. use App\Entity\Testimonial;
  5. use Doctrine\ORM\EntityManagerInterface;
  6. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  7. use Symfony\Component\HttpFoundation\Request;
  8. use Symfony\Component\HttpFoundation\Response;
  9. use Symfony\Component\Routing\Annotation\Route;
  10. class TestimonialDefaultController extends AbstractController
  11. {
  12.     /**
  13.      * @CmsComponent("Embed Testimonials", active=true, routeName="embed_testimonials")
  14.      */
  15.     #[Route(path'/pcgc-testimonials'name'embed_testimonials')]
  16.     public function embedTestimonials(Request $requestEntityManagerInterface $em): \Symfony\Component\HttpFoundation\Response
  17.     {
  18.         $query $em->createQuery('SELECT e FROM App:Testimonial e WHERE e.deleted = 0 AND e.active = 1');
  19.         $testimonials $query->getResult();
  20.         return $this->render('@theme/testimonial/testimonials.html.twig', [
  21.             'testimonials' => $testimonials,
  22.         ]);
  23.     }
  24.     /**
  25.      * @CmsComponent("Embed Testimonial", active=true, routeName="embed_testimonial")
  26.      */
  27.     #[Route(path'/pcgc-testimonials/{slug}'name'embed_testimonial')]
  28.     public function embedTestimonial(Request $requestEntityManagerInterface $em$slug): \Symfony\Component\HttpFoundation\Response
  29.     {
  30.         $testimonial $em->getRepository(Testimonial::class)->findOneBy(['slug' => $slug]);
  31.         return $this->render('@theme/testimonials/testimonial.html.twig', [
  32.             'testimonial' => $testimonial,
  33.         ]);
  34.     }
  35.     /**
  36.      * @CmsComponent("Embed Featured Testimonials", active=true, routeName="embed_featured_testimonials")
  37.      */
  38.     #[Route(path'/pcgc-testimonials/featured'name'embed_featured_testimonials')]
  39.     public function embedFeaturedTestimonials(Request $requestEntityManagerInterface $em): \Symfony\Component\HttpFoundation\Response
  40.     {
  41.         $testimonials $em->getRepository(Testimonial::class)->findBy(['featured' => true]);
  42.         return $this->render('@theme/testimonial/featuredSlider.html.twig', [
  43.             'testimonials' => $testimonials,
  44.         ]);
  45.     }
  46. }