Is a Model without a db table possible? (2 posts)

  1. davelopware
    Posted 2 years ago #

    I've got a use case where I'm processing some data and would like a model-view-controller set, but where the model is simple a collection of objects which result from some processing.

    In the more general case, a model might 'back' onto an rss feed, 3rd party JSON api, etc etc etc.

    Has anyone done anything like this with WP MVC yet?

    A quick inspection of mvc_model.php suggests it's pretty db specific.

    My instinct would be to have an abstract base MvcModel (or interface) and a MvcDatabase based implementation derived from it. Maybe MvcModelBase as the abstract class, and MvcModel as the Database backed implementation of it.

    Thoughts / suggestions greatly appreciated


  2. davelopware
    Posted 2 years ago #

    In the absence of anyone else looking at this, I've made a start on it. You can find it on my fork of the code on github here:


    the commit associated with this change is here:


    and the commit comment has a simple example of how you can extend MvcModel to implement a model that ISN'T backed onto a database. The example shows the beginning of a model which enumerates the File System (directories and files) for the WordPress installation.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic


No tags yet.