Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: better implementation of section model #1286

Closed
exponentcms opened this issue Apr 28, 2020 · 5 comments
Closed

Feature request: better implementation of section model #1286

exponentcms opened this issue Apr 28, 2020 · 5 comments
Assignees
Labels
feature request a new feature not yet incorporated into the code navigation

Comments

@exponentcms
Copy link
Owner

We could make much better use of the 'section' model beyond its current use to access the database for creation, selection, and deletion. Because of this we do not truly use it as a 'model' in most of the views/actions and tend to pass the entire menu/page hierarchy as an array of data. Besides we still access the global $db object from within the controller...which should be moved to within the model. The model could NOT include Ajax/JSON based methods since they must be made to the controller. Some possible model methods (which may or may not already be within the navigationController) could be:

  • getParent()
  • getTopParent()
  • getSiblings()
  • getChildren() - perhaps with params as to the depth such as all immediate children or all subordinates...of only a single depth down, etc...
  • hasChildren()
  • isTopLevel()
  • isStandAlone()
  • isPublic()
  • some of the delete/remove method now in the controller? rebuild_sectionrefs()
@exponentcms
Copy link
Owner Author

[bulk edit]

@exponentcms
Copy link
Owner Author

Methods moved from controller to model

  • hasChildren()
  • getChildren() ... current params are section & yui (format)? added a 'single level' param
  • canView()
  • isPublic()
  • rebuild_sectonrefs() moved to sectionref model (duh?)

New simple methods added

  • isTopLevel()
  • isStandalone()
  • getParent()
  • getSiblings()
  • getTopParent()

@exponentcms
Copy link
Owner Author

(from [09030bc]) Feature request: better implementation of section model [#1242 state:resolved]
09030bc

@exponentcms
Copy link
Owner Author

(from [5d78495]) Converts several new methods in section model from static methods to object methods [#1242]
5d78495

@exponentcms
Copy link
Owner Author

@exponentcms exponentcms added the feature request a new feature not yet incorporated into the code label Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request a new feature not yet incorporated into the code navigation
Projects
None yet
Development

No branches or pull requests

2 participants