declare(strict_types=1);
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
final class Book
{
#[
ORM\Id,
ORM\Column(unique: true),
ORM\GeneratedValue(strategy: 'AUTO'),
]
public int $id;
#[ORM\Column]
public string $name;
#[ORM\Column(type: StatusEnum::class)]
public StatusEnum $status;
}
use App\Entity\StatusEnum;
use BenTools\Doctrine\NativeEnums\Type\NativeEnum;
use Doctrine\DBAL\Types\Type;
NativeEnum::registerEnumType(StatusEnum::class);
// NativeEnum::registerEnumType('status', StatusEnum::class); // Alternatively, if you want your type to be named "status"
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.