I have the following code:
namespace Acme\StoreBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Acme\StoreBundle\Entity\User
*
* @ORM\Table(name="users")
* @ORM\Entity()
*/
class User {
...
}
$user = new User();
Does anybody know how I can now get the entity name (AcmeStoreBundle:User) from the User object?
This should always work (no return of Proxy class):
As
getClassMetadatais deprecated, you can now usegetMetadataFor