[PR #1690] [MERGED] WIP: Entity Repo & Controller Refactor #5862

Closed
opened 2026-02-05 10:18:58 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/BookStackApp/BookStack/pull/1690
Author: @ssddanbrown
Created: 9/27/2019
Status: Merged
Merged: 10/5/2019
Merged by: @ssddanbrown

Base: masterHead: repo_refactor


📝 Commits (10+)

  • 0ff10e2 Started mass-refactoring of the current entity repos
  • 458aca9 Rewrote book tree logic
  • 39455ca Extracted and split book sort logic
  • 97b7720 Finished up Book controller/repo organisation
  • 4b24866 Refactored bookshelves controllers and repo parts
  • 3c1b96f Fixed issues found via phpunit
  • 5ba87c5 Refactored Chapter controller
  • 9810dee Updated Chapter export controller
  • 32de136 Started Page controller/repo refactor
  • 9ba11bf Refactored another chunk of PageController

📊 Changes

72 files changed (+2686 additions, -2732 deletions)

View changed files

📝 app/Actions/ActivityService.php (+3 -2)
📝 app/Actions/ViewService.php (+3 -2)
📝 app/Auth/Permissions/PermissionService.php (+29 -31)
📝 app/Auth/Role.php (+12 -3)
📝 app/Auth/User.php (+12 -1)
📝 app/Auth/UserRepo.php (+28 -40)
📝 app/Entities/Book.php (+31 -26)
📝 app/Entities/BookChild.php (+40 -1)
📝 app/Entities/Bookshelf.php (+26 -27)
📝 app/Entities/BreadcrumbsViewComposer.php (+3 -2)
📝 app/Entities/Chapter.php (+16 -18)
📝 app/Entities/Entity.php (+57 -27)
📝 app/Entities/EntityProvider.php (+3 -17)
📝 app/Entities/ExportService.php (+36 -55)
app/Entities/HasCoverImage.php (+20 -0)
app/Entities/Managers/BookContents.php (+204 -0)
📝 app/Entities/Managers/EntityContext.php (+13 -19)
app/Entities/Managers/PageContent.php (+304 -0)
app/Entities/Managers/PageEditActivity.php (+74 -0)
app/Entities/Managers/TrashCan.php (+109 -0)

...and 52 more files

📄 Description

Fairly large scale refactor of the current entity code.
Thought now would be a good time to look over this, before we spin out the API.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/BookStackApp/BookStack/pull/1690 **Author:** [@ssddanbrown](https://github.com/ssddanbrown) **Created:** 9/27/2019 **Status:** ✅ Merged **Merged:** 10/5/2019 **Merged by:** [@ssddanbrown](https://github.com/ssddanbrown) **Base:** `master` ← **Head:** `repo_refactor` --- ### 📝 Commits (10+) - [`0ff10e2`](https://github.com/BookStackApp/BookStack/commit/0ff10e2c25863374f9d03ca17f8878621c725d01) Started mass-refactoring of the current entity repos - [`458aca9`](https://github.com/BookStackApp/BookStack/commit/458aca99331af15b47dd57793f59a68acaa48353) Rewrote book tree logic - [`39455ca`](https://github.com/BookStackApp/BookStack/commit/39455ca8c3865f6a94853f88c9eb7691319e3502) Extracted and split book sort logic - [`97b7720`](https://github.com/BookStackApp/BookStack/commit/97b7720b3c9d1d21169b4dd591d193f856b69e73) Finished up Book controller/repo organisation - [`4b24866`](https://github.com/BookStackApp/BookStack/commit/4b2486688f347e7246b8dfdd887c41e3996f1c69) Refactored bookshelves controllers and repo parts - [`3c1b96f`](https://github.com/BookStackApp/BookStack/commit/3c1b96f7ee8bb912f163ac9bd47441c6148d2f99) Fixed issues found via phpunit - [`5ba87c5`](https://github.com/BookStackApp/BookStack/commit/5ba87c5e995fdcbba43451e0806aacc422e40dc7) Refactored Chapter controller - [`9810dee`](https://github.com/BookStackApp/BookStack/commit/9810deeb726beefeb5c7dd5c7bba182bcf0f01b7) Updated Chapter export controller - [`32de136`](https://github.com/BookStackApp/BookStack/commit/32de136c7e2a64930ee4fbbad0df210e6526db82) Started Page controller/repo refactor - [`9ba11bf`](https://github.com/BookStackApp/BookStack/commit/9ba11bf7bd278374caeeb9899ae4a9c119949d4e) Refactored another chunk of PageController ### 📊 Changes **72 files changed** (+2686 additions, -2732 deletions) <details> <summary>View changed files</summary> 📝 `app/Actions/ActivityService.php` (+3 -2) 📝 `app/Actions/ViewService.php` (+3 -2) 📝 `app/Auth/Permissions/PermissionService.php` (+29 -31) 📝 `app/Auth/Role.php` (+12 -3) 📝 `app/Auth/User.php` (+12 -1) 📝 `app/Auth/UserRepo.php` (+28 -40) 📝 `app/Entities/Book.php` (+31 -26) 📝 `app/Entities/BookChild.php` (+40 -1) 📝 `app/Entities/Bookshelf.php` (+26 -27) 📝 `app/Entities/BreadcrumbsViewComposer.php` (+3 -2) 📝 `app/Entities/Chapter.php` (+16 -18) 📝 `app/Entities/Entity.php` (+57 -27) 📝 `app/Entities/EntityProvider.php` (+3 -17) 📝 `app/Entities/ExportService.php` (+36 -55) ➕ `app/Entities/HasCoverImage.php` (+20 -0) ➕ `app/Entities/Managers/BookContents.php` (+204 -0) 📝 `app/Entities/Managers/EntityContext.php` (+13 -19) ➕ `app/Entities/Managers/PageContent.php` (+304 -0) ➕ `app/Entities/Managers/PageEditActivity.php` (+74 -0) ➕ `app/Entities/Managers/TrashCan.php` (+109 -0) _...and 52 more files_ </details> ### 📄 Description Fairly large scale refactor of the current entity code. Thought now would be a good time to look over this, before we spin out the API. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 10:18:58 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#5862