Closed gam6itko closed 3 years ago
Can you provide a code for yours Entity?
You should use something like this if i understand you correctly:
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM; // Import doctrine mappings
/**
* @ORM\Entity() // Use imported mappings
*/
class MyEntity {
// ...
}
@skar my code example
<?php
declare(strict_types=1);
namespace App\Entity;
use App\Model\Email;
use App\Model\Phone;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use InvalidArgumentException;
use JsonSerializable;
use Mezzio\Authentication\UserInterface;
use OpenApi\Annotations as OA;
use Ramsey\Uuid\Doctrine\UuidGenerator;
use Ramsey\Uuid\UuidInterface;
/**
*
* @ORM\Entity(repositoryClass="App\Repository\AccountRepository")
* @ORM\Table(name="account")
*/
class Account implements JsonSerializable, UserInterface
{
As you can see I have use Doctrine\ORM\Mapping as ORM;
. But Doctrine Annotation reader can't load this class
Ok, this code looks fine. Сan you provide annotations with which you are having problems (e.g. full error message)? I'll check it and fix because annotation loader is deprecated solution.
https://github.com/doctrine/annotations/issues/182
Looks like i need to add AnnotationRegistry::registerLoader('class_exists')
somewhere in my bootstrap file.
And this is not your lib issue
When I try to execute one of the commands I've got the error
Here is my solution