Symfony and Doctrine2 - get info from annotations -


i have entity user field username (with appriopriate getter , setter) maps field user_name in table users. in userrepository fetch 1 record database , have $user of class user. how can find out table , field name $user->username ? need somehow fetch information annotations. found information in doctrine2 cache , found class classmetadatainfo documentation don't know how put together.

you should able class metadata of specific class doing so:

$entitymanager->getclassmetadata(get_class($user)) 

Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -