1. Go to this page and download the library: Download heymoon/doctrine-psql-enum 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/ */
heymoon / doctrine-psql-enum example snippets
use HeyMoon\DoctrinePostgresEnum\Attribute\EnumType;
#[EnumType('auth_status')]
enum AuthStatus: string
{
case New = 'new';
case Active = 'active';
case Inactive = 'inactive';
case Deleted = 'deleted';
}
#[EnumType('auth_service')]
enum Service: string
{
case Google = 'google';
}
$this->addSql('DROP TYPE IF EXISTS auth_status');
$this->addSql('CREATE TYPE auth_status AS ENUM (\'new\',\'active\',\'inactive\',\'deleted\')');
$this->addSql('DROP TYPE IF EXISTS auth_service');
$this->addSql('CREATE TYPE auth_service AS ENUM (\'google\')');
$this->addSql('CREATE TABLE auth (id UUID NOT NULL, status auth_status NOT NULL, service auth_service NOT NULL, PRIMARY KEY(id))');
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.