Skip to content

Begin work on Entity/Data model for Registrations

This is a bit experimental:

I'm suggesting a data model for the register table: Zotlabs\Data\Registration.

This class currently only handles getting a registration from the database, instantiating a Zotlabs\Entity\Registration class from the data, and instantiates itself with a reference to the entity class.

Method calls and property references that are not satisfied by the class itself is delegated to the entity. This allows us to use the data model class as if it was the entity, but lets us add methods to handle the database interactions separately.

I'm thinking this could be a model for keeping the business logic separate from the database interactions.

Also note that I dropped the BaseObject base class from the Entity, as it is now it's more in the way than useful. I do see some opportunities to refactor things back out, or to other reusable components (Traits, Attributes) later. The same with the data model class.

If this seems like a usable model, I'll continue transforming the rest of the registration related code towards this, and eventually other entities as well.

Merge request reports

Loading