title: How to install Doctrine Extensions in a Symfony2 project
body: <p>I guess that this is really trivial and stupid question, but I don't know how to install Doctrine Extensions - <a href="https://github.com/beberlei/DoctrineExtensions" rel="noreferrer">https://github.com/beberlei/DoctrineExtensions</a> in my Symfony2 project. I need them because of the MONTH, YEAR functions. Where should I put their  folder? And should I put the whole <code>DoctrineExtensions</code> folder? And where to write this:</p>
  
  <pre><code>&lt;?php
  
  $classLoader = new \Doctrine\Common\ClassLoader('DoctrineExtensions', "/path/to/extensions");
  $classLoader-&gt;register(); 
  </code></pre>
  
  <p>In a separate file? Where to put it and how to call it? </p>
  
  <p>And then is this all I need to use them:</p>
  
  <pre><code>public function findOneByYearMonthDay($year, $month, $day)
  {
      $emConfig = $this-&gt;getEntityManager()-&gt;getConfiguration();
      $emConfig-&gt;addCustomDatetimeFunction('YEAR', 'DoctrineExtensions\Query\Mysql\Year');
      $emConfig-&gt;addCustomDatetimeFunction('MONTH', 'DoctrineExtensions\Query\Mysql\Month');
      $emConfig-&gt;addCustomDatetimeFunction('DAY', 'DoctrineExtensions\Query\Mysql\Day');
  </code></pre>
  
  <p>Thank you very much in advance and sorry once again for the question, but I couldn't find a tutorial (which makes me feel even more guilty, because I guess it's too trivial when there isn't even a tutorial) </p>