api-platform / core

The server component of API Platform: hypermedia and GraphQL APIs in minutes
https://api-platform.com
MIT License
2.39k stars 848 forks source link

Call to a member function getClassMetadata() on null #4188

Closed grzegorz-stolarz closed 3 years ago

grzegorz-stolarz commented 3 years ago

API Platform version(s) affected: v2.6.3 Description
Fails on new Entity of new namespace, works for other, but for this one not.

How to reproduce
`<?php

declare(strict_types=1);

namespace App\Contact\Entity;

use ApiPlatform\Core\Annotation\ApiFilter; use ApiPlatform\Core\Annotation\ApiResource; use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\DateFilter; use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\OrderFilter; use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter; use App\Program\Entity\Client; use Doctrine\ORM\Mapping as ORM; use Gedmo\Blameable\Traits\BlameableEntity; use Gedmo\Timestampable\Traits\TimestampableEntity; use Ramsey\Uuid\UuidInterface; use Ramsey\Uuid\Doctrine\UuidGenerator; use Symfony\Component\Validator\Constraints as Assert; use Misd\PhoneNumberBundle\Validator\Constraints\PhoneNumber as AssertPhoneNumber;

/**

norkunas commented 3 years ago

That's probably because your doctrine registry can't find a manager for your entity, try to configure mapping for doctrine to that path

grzegorz-stolarz commented 3 years ago

That's probably because your doctrine registry can't find a manager for your entity, try to configure mapping for doctrine to that path

Yes, You're right, I'll close issue.