Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 Symfony2 中将逻辑实体名称解析为完整的类名称?喜欢。MyAcmeBundle:User_My\AcmeBundle\Entity\User
MyAcmeBundle:User
My\AcmeBundle\Entity\User
您可以从 EntityManager 获取 ClassMetadata,它将命名空间解析为完全限定的类名。
<?php echo $manager->getClassMetadata('MyAcmeBundle:User')->getName();