migrations/Version20221006202849.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use App\Notification\AutomaticPaymentSuccessfullReceiptAttachedAsPDFNotification;
  5. use App\Notification\PaymentReceiptReceiptAttachedAsPDFNotification;
  6. use Doctrine\DBAL\Schema\Schema;
  7. use Doctrine\Migrations\AbstractMigration;
  8. /**
  9.  * Auto-generated Migration: Please modify to your needs!
  10.  */
  11. final class Version20221006202849 extends AbstractMigration
  12. {
  13.     public function getDescription(): string
  14.     {
  15.         return 'Add objects table with payment info to payment notifications';
  16.     }
  17.     public function up(Schema $schema): void
  18.     {
  19.         // this up() migration is auto-generated, please modify it to your needs
  20.         $text_email_no '<p>Hei %user_name%</p><p>Takk for betaling. Detaljer om utlevering og forsendelse finner du her.</p> %receipt%';
  21.         $text_email_en '<p>Dear %user_name%</p><p>Thank you for your payment. Please find your receipt attached. For details regarding collection and shipping, see here.</p> %receipt%';
  22.         $this->addSql("UPDATE notification_template SET text_email = '{$text_email_no}' WHERE notification_type = '" PaymentReceiptReceiptAttachedAsPDFNotification::TYPE "' AND notification_language = 'nor-NO'");
  23.         $this->addSql("UPDATE notification_template SET text_email = '{$text_email_en}' WHERE notification_type = '" PaymentReceiptReceiptAttachedAsPDFNotification::TYPE "' AND notification_language = 'eng-GB'");
  24.         $text_email_no '<p>Hei %user_name%</p><p>Gratulerer med ditt kjøp hos Blomqvist. Automatisk betaling har blitt gjennomført med ditt lagrede kort. <a href="http://www.blomqvist.no/">Detaljer om utlevering og forsendelse finner du her.</a></p> %receipt%';
  25.         $text_email_en '<p>Dear %user_name%</p><p>Congratulations with your purchase from Blomqvist. An automatic payment with your stored card has been made. Please find your receipt attached. For details regarding collection and shipping, see here.</p> %receipt%';
  26.         $this->addSql("UPDATE notification_template SET text_email = '{$text_email_no}' WHERE notification_type = '" AutomaticPaymentSuccessfullReceiptAttachedAsPDFNotification::TYPE "' AND notification_language = 'nor-NO'");
  27.         $this->addSql("UPDATE notification_template SET text_email = '{$text_email_en}' WHERE notification_type = '" AutomaticPaymentSuccessfullReceiptAttachedAsPDFNotification::TYPE "' AND notification_language = 'eng-GB'");
  28.     }
  29.     public function down(Schema $schema): void
  30.     {
  31.         // this down() migration is auto-generated, please modify it to your needs
  32.         $text_email_no '<p>Hei %user_name%</p><p>Takk for betaling. Detaljer om utlevering og forsendelse finner du her.</p>';
  33.         $text_email_en '<p>Dear %user_name%</p><p>Thank you for your payment. Please find your receipt attached. For details regarding collection and shipping, see here.</p>';
  34.         $this->addSql("UPDATE notification_template SET text_email = '{$text_email_no}' WHERE notification_type = '" PaymentReceiptReceiptAttachedAsPDFNotification::TYPE "' AND notification_language = 'nor-NO'");
  35.         $this->addSql("UPDATE notification_template SET text_email = '{$text_email_en}' WHERE notification_type = '" PaymentReceiptReceiptAttachedAsPDFNotification::TYPE "' AND notification_language = 'eng-GB'");
  36.         $text_email_no '<p>Hei %user_name%</p><p>Gratulerer med ditt kjøp hos Blomqvist. Automatisk betaling har blitt gjennomført med ditt lagrede kort. <a href="http://www.blomqvist.no/">Detaljer om utlevering og forsendelse finner du her.</a></p>';
  37.         $text_email_en '<p>Dear %user_name%</p><p>Congratulations with your purchase from Blomqvist. An automatic payment with your stored card has been made. Please find your receipt attached. For details regarding collection and shipping, see here.</p>';
  38.         $this->addSql("UPDATE notification_template SET text_email = '{$text_email_no}' WHERE notification_type = '" AutomaticPaymentSuccessfullReceiptAttachedAsPDFNotification::TYPE "' AND notification_language = 'nor-NO'");
  39.         $this->addSql("UPDATE notification_template SET text_email = '{$text_email_en}' WHERE notification_type = '" AutomaticPaymentSuccessfullReceiptAttachedAsPDFNotification::TYPE "' AND notification_language = 'eng-GB'");
  40.     }
  41. }