-
-
Couldn't load subscription status.
- Fork 146
-
I'm doing something wrong here, but I can't figure out what. I'm generating
use App\Repository\AlbumRootsRepository; use Doctrine\ORM\Mapping as ORM; #[ORM\Entity('App\Repository\AlbumRootsRepository::class')] #[ORM\Table(name: 'AlbumRoots')] final class AlbumRoots
instead of
#[ORM\Entity(AlbumRootsRepository::class)]
#[ORM\Table(name: 'AlbumRoots')]
final class AlbumRoots
The Repository use statement is generated correctly, as seen above, but the entity is comint out as a string.
I'm almost certain this is something simple and basic, but I'm missing it.
$tableName = 'AlbumRoots'; $namespace = new PhpNamespace('App\Entity'); $namespace->addUse('Doctrine\ORM\Mapping', 'ORM'); $namespace->addUse($repoNs = "App\\Repository\\{$tableName}Repository"); $class = new ClassType($tableName); $class->addAttribute('Doctrine\ORM\Mapping\Entity', [$repoNs . '::class']);
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment