migrations/Version20240606132140DataUpdate.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use App\Entity\Company\CompanyType;
  5. use App\Entity\Notification\NotificationArea;
  6. use Doctrine\DBAL\Schema\Schema;
  7. use Doctrine\Migrations\AbstractMigration;
  8. use Doctrine\ORM\EntityManagerInterface;
  9. use Symfony\Component\DependencyInjection\ContainerAwareInterface;
  10. use Symfony\Component\DependencyInjection\ContainerAwareTrait;
  11. /**
  12.  * Auto-generated Migration: Please modify to your needs!
  13.  */
  14. final class Version20240606132140DataUpdate extends AbstractMigration implements ContainerAwareInterface
  15. {
  16.     use ContainerAwareTrait;
  17.     public function getDescription(): string
  18.     {
  19.         return '';
  20.     }
  21.     public function up(Schema $schema): void
  22.     {
  23.         /** @var EntityManagerInterface $entityManger */
  24.         $entityManager $this->container->get('doctrine.orm.entity_manager');
  25.         $newNotificationAreaCommentUserTag = new NotificationArea(
  26.             NotificationArea::COMMENT_USER_TAG,
  27.             'You have been tagged',
  28.             'projects',
  29.         );
  30.         $entityManager->persist($newNotificationAreaCommentUserTag);
  31.         $entityManager->flush();
  32.     }
  33. }