mirror of
https://github.com/doctrine/orm.git
synced 2026-04-24 06:58:19 +02:00
3fda5629f6
The enumType option on #[Column] was barely mentioned in the docs and had no dedicated section. This adds a complete reference covering single-value columns, collection types (json, simple_array), automatic type inference, validation behavior, and platform compatibility.
25 lines
452 B
PHP
25 lines
452 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Entity;
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
#[ORM\Entity]
|
|
class Player
|
|
{
|
|
#[ORM\Id]
|
|
#[ORM\GeneratedValue]
|
|
#[ORM\Column]
|
|
private int $id;
|
|
|
|
/** @var list<Suit> */
|
|
#[ORM\Column(type: 'json', enumType: Suit::class)]
|
|
private array $favouriteSuits = [];
|
|
|
|
/** @var list<Suit> */
|
|
#[ORM\Column(type: 'simple_array', enumType: Suit::class)]
|
|
private array $allowedSuits = [];
|
|
}
|