My entity class has a MasterTitle relation and title getter:
public function getTitle()
{
$definition = $this->Definition;
$paramPhrase = \XF::phrase($this->getPhraseName());
return $paramPhrase->render('html', ['nameOnInvalid' => false]) ?: ($definition ? $definition->title : '');
}...