<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to_dict(self):
 """ Return entity data as a dictionary """

        return {field_name: getattr(self, field_name, None)
                for field_name in self.meta_.declared_fields}