<?php
declare(strict_types=1);
namespace App\Controller\Admin;
use Doctrine\ORM\EntityManagerInterface;
use JMS\JobQueueBundle\Entity\Job;
use Sonata\AdminBundle\Controller\CRUDController;
class ArchiveMovieController extends CRUDController
{
/** @var EntityManagerInterface $em */
private $em;
public function __construct(EntityManagerInterface $em)
{
$this->em = $em;
}
public function listAction()
{
$job = new Job('fetch:archivemovie');
$this->em->persist($job);
$this->em->flush();
return $this->redirectToRoute('jms_jobs_details', ['id' => $job->getId()]);
}
}