Model Scopes

Hi all,

I have been going thinking about model scopes, and how best to implement it in phalcon. I have an idea, its not concrete yet, but i shall work on it and provide a POC.

But here's the concept of how it will work, not entirely sure if this is the right way to implement it, but i am hoping that people with more experience would clarify it for me.

  1. MVC Query will be rewritten to be more of database model object
    • Explaination:
    • Query will be the base class your model is based upon, and scopes will be defined here.
    • Query will contain method for converting it into model view objects.
  2. MVC model will serve as model view object
    • Explaination:
    • Fields should now be dynamic, meaning there will no longer be any fields declared, everything is dynamically set by the scope
    • Relationships will still be handled here.
  3. MVC Model Manager will become Model View Manager
  4. Need to add an addtitional Database model manager ?

I believe these are the 4 steps needed. Experts please fill this thread!


Has this moved forward?