A proposed entity/data model
I've submitted a MR that I would like some feedback about. As it's a bit of an architectural issue, I think it's good if we discuss whether we feel it's a good direction or not before jumping all feet into it.
#^https://framagit.org/hubzilla/core/-/merge_requests/2176This work is an attempt at merging my stalled attempt at moving database access into "models" in
MR 2153 with the Entity concept introduced by the
containers
branch.
Personally I think it looks pretty good. It enables a separation between the Entity classes themselves and the database access, while still allowing for simple and consistent usage. See the changes in the
account_allow()
function, as well as the
RegistrationTest
for an example.
Note also that most of the stuff in
Zotlabs\Data\Registration
is fairly generic. Which leads me to think there's room for moving some of that stuff into a base class. The goal is to make these classes as ergonomic as possible.
It's probably a good idea to follow each commit to see some of the thought process that lead to the result.