title: How to get Doctrine2 entity identifier without knowing its name
body: <p>I am attempting to create an abstracted getId method on my base Entity class in Symfony2 using Doctrine2 for a database where primary keys are named inconsistently across tables.</p>
  
  <p>When inspecting entity objects I see there is a private '_identifier' property that contains the information I am trying to retrieve but I am not sure how to properly access it.</p>
  
  <p>I'm assuming there is some simple Doctrine magic similar to:</p>
  
  <pre><code>public function getId()
  {
      return $this-&gt;getIdentifier();
  }
  </code></pre>
  
  <p>But I haven't managed to find it on the intertubes anywhere.</p>