title: modelling database entities in MVC -- how to create them?
body: <p>I'm working on a PHP web app and I'm trying to use the MVC model. I have a lot of things that exist as 'database entities' -- a row, or a set of related rows, that are conceptually one  human recognizable 'thing'. So I often try to provide an interface to that thing in a model class. </p>
  
  <p>So of course, the run of the mill functionality is to have an existing entity, get some data from it, and sometimes update it. However, where I run into problems is when I need to create a new entity. None of the default data for an existing entity exists yet!</p>
  
  <p>For instance, my  <code>__construct()</code> methods will often have arguments (i.e. <code>$id</code> for <code>WHERE id = $id</code>) so that I can select data from the database and populate all the properties of the object from that data. However, when I want to create a new entity, the values for those arguments don't exist yet! </p>
  
  <p>How do you all handle this situation? Do you </p>
  
  <ul>
  <li>try to provide functionality for both creation and subsequent manipulation in the same object</li>
  <li>have another class just for generating the entity</li>
  <li>avoid <code>__construct</code> and have somthing like <code>create()</code> for new entities and <code>instantiate()</code> for existing ones</li>
  <li>something else?</li>
  </ul>