Relationships
The model layer uses standard WPFluent relation helpers such as belongsTo, hasMany, belongsToMany, and hasManyThrough.
Relationship Inventory
| Source | Method | Type | Target |
|---|---|---|---|
Activity | feed | belongsTo | Feed |
Activity | space | belongsTo | BaseSpace |
Activity | user | belongsTo | User |
Activity | xprofile | belongsTo | XProfile |
BaseSpace | owner | belongsTo | User |
BaseSpace | space_pivot | belongsTo | SpaceUserPivot |
BaseSpace | admins | belongsToMany | User |
BaseSpace | posts | hasMany | Feed |
BaseSpace | comments | hasManyThrough | Comment |
BaseSpace | members | belongsToMany | User |
BaseSpace | x_members | belongsToMany | XProfile |
BaseSpace | group | belongsTo | SpaceGroup |
Comment | user | belongsTo | User |
Comment | xprofile | belongsTo | XProfile |
Comment | media | hasOne | Media |
Comment | post | belongsTo | Feed |
Comment | space | hasOneThrough | BaseSpace |
Comment | reactions | hasMany | Reaction |
Course | owner | belongsTo | User |
Course | space_pivot | belongsTo | SpaceUserPivot |
Course | admins | belongsToMany | User |
Course | posts | hasMany | Feed |
Course | comments | hasManyThrough | Comment |
Course | members | belongsToMany | User |
Course | x_members | belongsToMany | XProfile |
Course | group | belongsTo | SpaceGroup |
Course | creator | hasOneThrough | XProfile |
Course | students | belongsToMany | User |
Course | course_topics | hasMany | CourseTopic |
Course | enrollment | belongsTo | SpaceUserPivot |
Course | student_enrollments | hasMany | SpaceUserPivot |
Course | group | belongsTo | SpaceGroup |
Course | categories | belongsToMany | Term |
CourseLesson | topic | belongsTo | CourseTopic |
CourseLesson | course | belongsTo | Course |
CourseLesson | owner | belongsTo | User |
CourseLesson | comments | hasMany | Comment |
CourseLesson | reactions | hasMany | Reaction |
CourseLesson | lessonCompleted | hasMany | Reaction |
CourseLesson | media | hasMany | Media |
CourseLesson | terms | belongsToMany | Term |
CourseTopic | lessons | hasMany | CourseLesson |
CourseTopic | owner | belongsTo | User |
CourseTopic | course | belongsTo | Course |
CourseTopic | comments | hasMany | Comment |
CourseTopic | reactions | hasMany | Reaction |
CourseTopic | terms | belongsToMany | Term |
Feed | user | belongsTo | User |
Feed | xprofile | belongsTo | XProfile |
Feed | space | belongsTo | BaseSpace |
Feed | comments | hasMany | Comment |
Feed | reactions | hasMany | Reaction |
Feed | follows | hasMany | Follow |
Feed | surveyVotes | hasMany | Reaction |
Feed | terms | belongsToMany | Term |
Feed | activities | hasMany | Activity |
Feed | notifications | hasMany | Notification |
Feed | media | hasMany | Media |
Follow | follower | belongsTo | XProfile |
Follow | followed | belongsTo | XProfile |
Media | feed | belongsTo | Feed |
Media | user | belongsTo | User |
Media | xprofile | belongsTo | XProfile |
Moderation | post | belongsTo | Feed |
Moderation | comment | belongsTo | Comment |
Moderation | reporter | belongsTo | XProfile |
Notification | subscribers | hasMany | NotificationSubscriber |
Notification | subscriber | hasOne | NotificationSubscriber |
Notification | feed | belongsTo | Feed |
Notification | src_user | belongsTo | User |
Notification | xprofile | belongsTo | XProfile |
NotificationPreference | user | belongsTo | User |
NotificationPreference | xprofile | belongsTo | XProfile |
NotificationSubscriber | user | belongsTo | User |
NotificationSubscriber | xprofile | belongsTo | XProfile |
NotificationSubscriber | notification | belongsTo | Notification |
NotificationSubscription | user | belongsTo | User |
NotificationSubscription | xprofile | belongsTo | XProfile |
Reaction | user | belongsTo | User |
Reaction | xprofile | belongsTo | XProfile |
Reaction | feed | belongsTo | Feed |
Reaction | comment | belongsTo | Comment |
SidebarLink | owner | belongsTo | User |
SidebarLink | space_pivot | belongsTo | SpaceUserPivot |
SidebarLink | admins | belongsToMany | User |
SidebarLink | posts | hasMany | Feed |
SidebarLink | comments | hasManyThrough | Comment |
SidebarLink | members | belongsToMany | User |
SidebarLink | x_members | belongsToMany | XProfile |
SidebarLink | group | belongsTo | SpaceGroup |
Space | owner | belongsTo | User |
Space | space_pivot | belongsTo | SpaceUserPivot |
Space | admins | belongsToMany | User |
Space | posts | hasMany | Feed |
Space | comments | hasManyThrough | Comment |
Space | members | belongsToMany | User |
Space | x_members | belongsToMany | XProfile |
Space | group | belongsTo | SpaceGroup |
SpaceGroup | owner | belongsTo | User |
SpaceGroup | spaces | hasMany | BaseSpace |
SpaceUserPivot | user | belongsTo | User |
SpaceUserPivot | xprofile | belongsTo | XProfile |
SpaceUserPivot | space | belongsTo | BaseSpace |
Term | posts | belongsToMany | Feed |
Term | base_spaces | belongsToMany | BaseSpace |
User | xprofile | belongsTo | XProfile |
User | follows | hasMany | Follow |
User | followers | hasMany | Follow |
User | usermeta | hasMany | UserMeta |
User | messages | hasMany | Message |
User | spaces | belongsToMany | BaseSpace |
User | courses | belongsToMany | Course |
User | notificationSubscriptions | hasMany | NotificationSubscription |
User | notificationPreferences | hasMany | NotificationPreference |
User | space_pivot | belongsTo | SpaceUserPivot |
User | notification_records | hasMany | NotificationSubscriber |
User | crm_contact | belongsTo | Contact |
User | community_role | belongsTo | Meta |
UserMeta | user | belongsTo | User |
XProfile | user | belongsTo | User |
XProfile | contact | hasOne | Contact |
XProfile | spaces | belongsToMany | BaseSpace |
XProfile | posts | hasMany | Feed |
XProfile | follows | hasMany | Follow |
XProfile | followers | hasMany | Follow |
XProfile | comments | hasMany | Comment |
XProfile | courses | belongsToMany | Course |
XProfile | space_pivot | belongsTo | SpaceUserPivot |
XProfile | community_role | belongsTo | Meta |