Closed christianostrem closed 2 years ago
Changing annotation from @ORM\CustomIdGenerator(class=UuidGenerator::class) To @ORM\CustomIdGenerator(class="Ramsey\Uuid\Doctrine\UuidGenerator")
Partially works; I get the metadata printed on screen but then it throws an error.
Cannot instantiate custom generator : array ( 'class' => 'UuidGenerator', )
But is now complaining about this
<?php
use App\Kernel;
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
The issue is now solved. The last issue was that the menu entity had a relation to a file with the wrong annotation.
So the conclusion is that you need to update your documentation for symfony annotation.
You need to change this: @Orm\CustomIdGenerator(class=UuidGenerator::class) To @Orm\CustomIdGenerator(class="Ramsey\Uuid\Doctrine\UuidGenerator")
Description
I am trying to fetch metadata from an entity with the Custom Strategy using this library.
This produces an error:
Cannot instantiate custom generator : array ( 'class' => 'UuidGenerator', )
The error is not thrown if i change the strategy to auto.
Steps to reproduce
Put this in a controller and trigger the function.
Get the metadata from an entity. This: "App\Entity\Menu" can be replaced with a entity you have and is using the custom strategy. This: "$this->em" is a refrence to __construct(EntityManagerInterface $em)
Expected behavior
Show metadata for the class
Environment details
Php: 8 doctrine: 2.11 Symfony: 6