Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • Thanks for all the great comments. Hard to choose a single "correct" answer, as they are all correct, but Bryan seems the most complete.
    – Scottie
    Commented Oct 2, 2012 at 16:44
  • 1
    "Model - business logic, interface to data store" and "The Model should never format data. It also should not read formatted data." So what happens when you have json data that you need to add to a database? Obviously the Model in your logic should not accept is as such, json. So it should be reowrked. By whom? By an interface into the Model. But you just stated that the interface is .... the "Model ... (is) interface to data store". There is at least a seeming contradiction there that needs to be resolved or clarified.
    – user2849202
    Commented Dec 19, 2016 at 1:42
  • Wow sure would be nice to have a small project example of your write up .. I think that would clarify things for me greatly. Even if it was simply name and address sample ..
    – Ken
    Commented Jul 18, 2018 at 8:28
  • In PHP, a model cannot do $stmt->fetch(PDO::FETCH_CLASS, $this). I can cast all the properties manually by $this->id = $object->id, but it could be really long and not easy to maintain (if there are any column changes). Does it mean PHP wants us to do the queries in Controllers? Or is there any proper code to replace: $stmt->fetch(PDO::FETCH_CLASS, $this)? Commented Mar 21, 2020 at 16:59
  • Many guides on MVC claim that user input must be inside controller though... Commented Jul 12, 2020 at 16:33