0

I am getting error Class "App\Entity\Admin\User" is not a valid entity or mapped super class.

I have a folder Admin under Entity which includes entities required for admin.

User.php

namespace App\Entity\Admin;

use DateTime;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;

#[ORM\Entity]
#[ORM\Table(name: 'user')]
#[ORM\HasLifecycleCallbacks]
class User
{

I have made following changes in doctrine.yaml

    mappings:
        App:
            is_bundle: false
            type: annotation
            dir: '%kernel.project_dir%/src/Entity'
            prefix: 'App\Entity'
            alias: App
        Admin:
            is_bundle: false
            type: attribute
            dir: '%kernel.project_dir%/src/Entity/Admin'
            prefix: 'App\Entity\Admin'
            alias: Admin
nas
  • 2,289
  • 5
  • 32
  • 67

0 Answers0