using Doctrine Reflections to find getter for specific fieldName
$fieldName = 'city';
$repository = $this->em->getRepository(get_class($obj));
$metaClass = $this->em->getClassMetadata(get_class($obj));
if (!$metaClass->hasField($fieldName) && !$metacClass->hasAssociation($fieldName)) {
return;
}
$value = $metaClass->reflFields[$fieldName]->getValue($obj);