Doctrine 2.5. When trying to create a proxy manually using
doctrine orm:generate-proxies
an exception is thrown:
[Teaching \ ORM \ ORMException]
Unable to instantiate custom generator: MyBundle \ MyCustomGenerator
I have a custom generator that works correctly:
/** * @ORM\Column(type="string") * @ORM\Id * @ORM\GeneratedValue(strategy="CUSTOM") * @ORM\CustomIdGenerator(class="MyBundle\MyCustomGenerator") */ protected $id;
Also, manually creating an instance of the generator, for example
$a = new MyBundle\MyCustomGenerator();
works. But for some reason, the Doctrine Console throws the above exception.
I tried to debug and check what happens.
An exception is defined in completeIdGeneratorMapping ClassMetadataFactory . I checked that $definition['class'] stores the name of my custom generator: MyBundle\MyCustomGenerator . But still, the Doctrine cannot find a class.
I think I should add the definition to cli-config.php as described in the document , with use MyBundle or use MyBundle\MyCustomGenerator , but this did not work - the same exception was thrown.
Any ideas how I can make the doctrine console aware of my user ID generator?
source share