migrations/Version20240911123506DataUpdate.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use App\Entity\Notification\NotificationArea;
  5. use App\Repository\Notification\NotificationAreaRepository;
  6. use Doctrine\DBAL\Schema\Schema;
  7. use Doctrine\Migrations\AbstractMigration;
  8. use Symfony\Component\DependencyInjection\ContainerAwareInterface;
  9. use Symfony\Component\DependencyInjection\ContainerAwareTrait;
  10. /**
  11.  * Auto-generated Migration: Please modify to your needs!
  12.  */
  13. final class Version20240911123506DataUpdate extends AbstractMigration implements ContainerAwareInterface
  14. {
  15.     use ContainerAwareTrait;
  16.     public function getDescription(): string
  17.     {
  18.         return '';
  19.     }
  20.     public function up(Schema $schema): void
  21.     {
  22.         $entityManager $this->container->get('doctrine.orm.entity_manager');
  23.         /** @var NotificationAreaRepository $notificationAreaRepository */
  24.         $notificationAreaRepository $entityManager->getRepository(NotificationArea::class);
  25.         $newComment $notificationAreaRepository->getNotificationAreaCommentNew();
  26.         $newComment->setVisibleName('New Comment');
  27.         $entityManager->persist($newComment);
  28.         $entityManager->flush();
  29.     }
  30.     public function down(Schema $schema): void
  31.     {
  32.         // this down() migration is auto-generated, please modify it to your needs
  33.     }
  34. }