title: Symfony and Doctrine - getDoctrine not found
body: <p>I am trying to build a simple app
  I have a database with a table "matches"<a href="https://i.stack.imgur.com/1ri7M.png" rel="nofollow noreferrer">the table structure</a></p>
  
  <p>and i wrote this code as Entity</p>
  
  <pre><code>&lt;?php
  
  namespace AppBundle\Entity;
  
  use Doctrine\ORM\Mapping as ORM;
  
  /**
   * @ORM\Entity
   * @ORM\Table(name="matches")
   */
  
  class Match
  {
      /**
       * @ORM\Column(type="integer")
       * @ORM\Id
       * @ORM\GeneratedValue(strategy="AUTO")
       */
      private $id;
  
      /**
       * @ORM\Column(type="text", length=512)
       */
      private $descr;
      /**
       * @ORM\Column(type="string", length=255)
       */
      private $team_a;
      /**
       * @ORM\Column(type="string", length=255)
       */
      private $team_b;
      /**
       * @ORM\Column(type="string", length=255)
       */
      private $location;
      /**
       * @ORM\Column(type="datetime")
       */
      private $datetime;
  
      /**
       * Get id
       *
       * @return integer
       */
      public function getId()
      {
          return $this-&gt;id;
      }
  
      /**
       * Set descr
       *
       * @param string $descr
       *
       * @return Match
       */
      public function setDescr($descr)
      {
          $this-&gt;descr = $descr;
  
          return $this;
      }
  
      /**
       * Get descr
       *
       * @return string
       */
      public function getDescr()
      {
          return $this-&gt;descr;
      }
  
      /**
       * Set teamA
       *
       * @param string $teamA
       *
       * @return Match
       */
      public function setTeamA($teamA)
      {
          $this-&gt;team_a = $teamA;
  
          return $this;
      }
  
      /**
       * Get teamA
       *
       * @return string
       */
      public function getTeamA()
      {
          return $this-&gt;team_a;
      }
  
      /**
       * Set teamB
       *
       * @param string $teamB
       *
       * @return Match
       */
      public function setTeamB($teamB)
      {
          $this-&gt;team_b = $teamB;
  
          return $this;
      }
  
      /**
       * Get teamB
       *
       * @return string
       */
      public function getTeamB()
      {
          return $this-&gt;team_b;
      }
  
      /**
       * Set location
       *
       * @param string $location
       *
       * @return Match
       */
      public function setLocation($location)
      {
          $this-&gt;location = $location;
  
          return $this;
      }
  
      /**
       * Get location
       *
       * @return string
       */
      public function getLocation()
      {
          return $this-&gt;location;
      }
  
      /**
       * Set datetime
       *
       * @param \DateTime $datetime
       *
       * @return Match
       */
      public function setDatetime($datetime)
      {
          $this-&gt;datetime = $datetime;
  
          return $this;
      }
  
      /**
       * Get datetime
       *
       * @return \DateTime
       */
      public function getDatetime()
      {
          return $this-&gt;datetime;
      }
  }
  </code></pre>
  
  <p>and this as controller:</p>
  
  <pre><code>&lt;?php
  
  namespace AppBundle\Controller;
  
  
  use AppBundle\Entity\Match;
  use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
  use Symfony\Component\HttpFoundation\Response;
  
  
  class AddMatch
  {
      /**
       * @Route("/addmatch")
       */
      public function createAction()
      {
          $match = new Match();
          $match-&gt;setDescr('Descrizione Partita');
          $match-&gt;setTeamA('Squadra A');
          $match-&gt;setTeamB('Squadra B');
          $match-&gt;setLocation('a nice Gym');
          $match-&gt;setLocation('12/12/2012');
          $em = $this-&gt;getDoctrine()-&gt;getManager();
  
  
          // tells Doctrine you want to (eventually) save the Product (no queries yet)
          $em-&gt;persist($match);
  
          // actually executes the queries (i.e. the INSERT query)
          $em-&gt;flush();
  
          return new Response('Saved new match with id '.$match-&gt;getId());
      }
  
  }
  </code></pre>
  
  <p>but it dosent work and I get <a href="https://i.stack.imgur.com/2yeg8.png" rel="nofollow noreferrer">Not Found</a></p>
  
  <p>What am I missing?
  I am super n00b :(
  thanks for your help</p>