Just as a preview to the proof of concept demo I almost have completed with the new Propel object-relational infrastructure and user merge (should have something very solid to show off this week):
In order to support legacy operations, I’ve basically left the data structures alone, except removing id’s from cross-reference tables and replacing them with compound primary keys for the foreign key relationships, and of course, merging web and manager user data into our new user data structures.
The demo is running a little slow on this first pass, but there is still lot’s more to do to define the new object-based API’s, remove redundant code (there is an enormous amount of this), reduce the size of the codebase itself, and improve the efficiency of the parsing processes with this new OO backend.
Re: recreating the functions, the new API’s will take care of this problem moving forward - I’m in the process of reviewing all the functionality in MODx and re-implementing the methods in the appropriate classes (e.g. User, UserGroup, Document, DocumentGroup, UserGroupDocumentGroup, TemplateVar, etc.) so we can do things like this to get the current authenticated User object:
UserPeer :: getAuthenticatedUser()
which would be aliased also as
$modx->getAuthenticatedUser()
no more checking $_SESSION[’mgrValidated’] or $_SESSION[’webValidated] in order to determine this stuff...
OR to get a collection of UserGroupDocumentGroup objects (representing the relationship between UserGroup and DocumentGroup objects)...
$memberships= $modx->user->getUserGroupMembershipsJoinUserGroup();
foreach ($memberships as $membership) {
$userGroupDocGroups[]= $membership->getUserGroup()->getUserGroupDocumentGroups();
}