PHP code example of core23 / doctrine-extensions

1. Go to this page and download the library: Download core23/doctrine-extensions library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

core23 / doctrine-extensions example snippets


// src/Migrations/Version123.php


namespace Application\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
use Nucleos\Doctrine\Migration\IdToUuidMigration;

class Version123 extends AbstractMigration
{
    private IdToUuidMigration $idToUuidMigration;

    public function __construct(Connection $connection, LoggerInterface $logger)
    {
        parent::__construct($connection, $logger);

        $this->idToUuidMigration = new IdToUuidMigration($this->connection, $logger);
    }


    public function postUp(Schema $schema): void
    {
        $this->idToUuidMigration->migrate('my_table_name');
    }
}

// config/bundles.php

return [
    // ...
    Nucleos\Doctrine\Bridge\Symfony\Bundle\NucleosDoctrineBundle::class => ['all' => true],
];