title: How do I setup up Doctrine's Class Inheritance in Symfony?
body: <p>My issue is, I'm having trouble grasping DiscriminatorColumn and DiscriminatorMap in Doctrine's Class Inheritance.</p>
  
  <p>I have a products entity that is considered the parent class / table.</p>
  
  <p>There are several child entities that inherit the product entity. (models, parts, and options)</p>
  
  <p>I feel like I should be able to use the primary key to link both tables... But how do I do that with DiscriminatorColumn?  </p>
  
  <p>Here is the general idea of what I want to happen...</p>
  
  <blockquote>
    <p>Fetch all <strong>model</strong> objects from database while inheriting product parent entity</p>
  </blockquote>
  
  <pre><code>SELECT object 
  FROM parts_object parts
  LEFT JOIN products_object po
  ON parts.product_fk = po.product_id
  </code></pre>
  
  <blockquote>
    <p>Or... Fetch all <strong>part</strong> objects from database while inheriting product parent entity</p>
  </blockquote>
  
  <pre><code>SELECT object 
  FROM parts_object parts
  LEFT JOIN products_object po
  ON parts.product_fk = po.product_id
  </code></pre>
  
  <p>Ideally I want this done using Doctrine instead of some custom SQL.</p>
  
  <p>Do I need to setup a "type" column for the parent table so each row defines whether it's a part, model, or option?</p>
  
  <p><a href="http://doctrine-orm.readthedocs.org/en/latest/reference/inheritance-mapping.html" rel="nofollow">Doctrine inheritance docs</a></p>