vendor/bluue/prestashop-connector-bundle/migrations/Version2023051910600.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace PrestashopConnectorBundleMigrations;
  4. use App\Services\ObjectSerialize;
  5. use Doctrine\DBAL\Schema\Schema;
  6. use Doctrine\Migrations\AbstractMigration;
  7. use Symfony\Component\Uid\UuidV6;
  8. final class Version2023051910600 extends AbstractMigration
  9. {
  10.     private ObjectSerialize $objectSerialize;
  11.     public function setObjectSerialize(ObjectSerialize $objectSerialize)
  12.     {
  13.         $this->objectSerialize $objectSerialize;
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.     }
  18.     public function down(Schema $schema): void
  19.     {
  20.     }
  21.     public function postUp(Schema $schema): void
  22.     {
  23.         parent::postUp($schema);
  24.         $now = (new \DateTime())->format('Y-m-d H:i:s');
  25.         $configurations = [
  26.             'prestashop_connector_bundle__multi_language_shop' => false
  27.         ];
  28.         foreach ($configurations as $configuration => $value) {
  29.             $this->connection->insert('configuration', [
  30.                 'id' => (new UuidV6())->toBinary(),
  31.                 'name' => $configuration,
  32.                 'context_id' => null,
  33.                 'value' => $this->objectSerialize->add((object) ['value' => $value]),
  34.                 'created_at' => $now,
  35.                 'updated_at' => $now,
  36.             ]);
  37.         }
  38.     }
  39. }