Add magic method __toString() to entities