I had to do something similar, what I did is:
1. I created a controller that returns the expected value
2. I created a service so that I can access that controller from anywhere
3. I call the service from within sonata, something like this:
$usrSrvc = $this->getConfigurationPool()->getContainer()->get('app.user_manager');
$user = $usrSrvc->getLoggedUser();
Now, remember that in your entity you need the setter and getter in order to set your data.
Hope this helps
L.