maker-bundle
maker-bundle copied to clipboard
make:entity Test --with-ulid or make:entity Test --with-ulid does not use Ulid/Uuid
Hi there, I love using Uuids / Ulids as primaries, and I jumped on this feature !
But it looks like it works only if we don't pass any parameters php bin/console make:entity --with-uuid
How to reproduce :
Execute php bin/console make:entity Test --with-uuid
( or php bin/console make:entity Test --with-ulid
)
Follow steps to class creation and quit.
Expected : The id field created like this :
#[ORM\Entity(repositoryClass: TestRepository::class)]
class Test
{
#[ORM\Id]
#[ORM\Column(type: UuidType::NAME, unique: true)]
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
#[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
private ?Uuid $id = null;
public function getId(): ?Uuid
{
return $this->id;
}
}
Actual result:
#[ORM\Entity(repositoryClass: TestRepository::class)]
class Test
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
public function getId(): ?int
{
return $this->id;
}
}