This behaviour is implemented directly in the entity:
public function __toString()
{
return $this->getFoo() ? : '-';
}
Bundles are using variants of this, including return (string)$this->getFoo();
or $this->getFoo() ? : 'n/a';
etc.
Related question: toString method for SonataAdminBundle Listing in Symfony2