<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use App\Entity\Notification\NotificationArea;
use App\Repository\Notification\NotificationAreaRepository;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240821095218DataUpdate extends AbstractMigration implements ContainerAwareInterface
{
use ContainerAwareTrait;
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$entityManager = $this->container->get('doctrine.orm.entity_manager');
/** @var NotificationAreaRepository $notificationAreaRepository */
$notificationAreaRepository = $entityManager->getRepository(NotificationArea::class);
$surveyAccepted = $notificationAreaRepository->getNotificationAreaSurveyAccepted();
$surveyAccepted->setVisibleName('Data Approved');
$entityManager->persist($surveyAccepted);
$surveyRejected = $notificationAreaRepository->getNotificationAreaSurveyReject();
$surveyRejected->setVisibleName('Data Rejected');
$entityManager->persist($surveyRejected);
$entityManager->flush();
}
}