#!/usr/bin/env php get(Application::class); $console->setAutoExit(false); $console->run(); try { // Persist data /** @var EntityManagerInterface $em */ $em = $container->get(EntityManagerInterface::class); $em->flush(); } catch (NotFoundExceptionInterface) { // Do nothing }