title: Doctrine 2.x CRUD
body: <p>I heard a lot of good stuff about ORM Doctrine. I can put lot of effort learning Doctrine using a great tutorial like <a href="http://www.phpandstuff.com/articles/codeigniter-doctrine-from-scratch-day-1-install-and-setup" rel="nofollow">http://www.phpandstuff.com/articles/codeigniter-doctrine-from-scratch-day-1-install-and-setup</a>, but it is quite outdated and is using Doctrine 1.x. I prefer learning Doctrine 2.x immediately in order to save time.</p>
  
  <p>I managed to install Doctrine 2.1 in combination with Codeigniter 2.0.3. I've already managed to do some basic operations like adding new objects and save them to the database. Now I'm trying something that shouldn't be too difficult, but I've spent quite some time to find out how to do the following:</p>
  
  <p>In case I want to create an object using $_POST data, I don't want to assign every property separately in code. I'd prefer something like $u->fromArray, e.g. as shown in</p>
  
  <pre><code>$data = array(
  'username' =&gt; 'myuser',
  'password' =&gt; 'mypass',
  'email' =&gt; 'my@email.com'
  );
  
  $u = new User();
  $u-&gt;fromArray($data);
  $u-&gt;save();
  </code></pre>
  
  <p>Source: <a href="http://www.phpandstuff.com/articles/codeigniter-doctrine-day-5-database-crud" rel="nofollow">http://www.phpandstuff.com/articles/codeigniter-doctrine-day-5-database-crud</a></p>
  
  <p>However, fromArray() doesn't exist in Doctrine 2.x anymore. Is there an equivalent for fromArray() in Doctrine 2.x?</p>
  
  <p>Second question: I find it pretty hard to get started. The official documents focus mainly on Doctrine. It would be very nice to have a practical example that includes things as form validation, crud operations etc. It would be very nice to have a MVC example project using Doctrine 2. Does anyone know of such a tutorial or example project?</p>