title: Twig instanceof for inheritance objects
body: <p>I am using the following feature from propel <a href="http://www.propelorm.org/documentation/09-inheritance.html" rel="noreferrer">http://www.propelorm.org/documentation/09-inheritance.html</a>.</p>
  
  <p>I am also using Symfony2 and Twig</p>
  
  <p>I have a class structure using the above feature that looks something like this</p>
  
  <pre><code>class Event {}
  
  class Birthday extends Event {}
  
  class Walking extends Event {}
  </code></pre>
  
  <p>now I pass an event object to a twig template and I want to know what type of event it is</p>
  
  <p>For instance I want to display an image of a cake if its a birthday and I want to display map routes if its walking event.</p>
  
  <p>I cannot use instanceof in Twig as this feature does not exist. 
  Does anyone now why this does not exist? 
  and is there a way I can replicate this functionality without having to do something like</p>
  
  <pre><code> public function getType()
  </code></pre>
  
  <p>in each class, or</p>
  
  <pre><code> public function isBirthday()
  </code></pre>
  
  <p>in the event class.</p>
  
  <p>I found this on github but it is of no use to me. I have commented on their to see if I can get an answer.</p>
  
  <p><a href="https://github.com/fabpot/Twig/issues/553" rel="noreferrer">https://github.com/fabpot/Twig/issues/553</a></p>