title: Doctrine 2.5: Unrecognized field (but only in Symfony's prod mode)
body: <p>So I seem to be plagued by issues that only affect production mode in Symfony and not developer mode. This time, I have a ManyToOne association and I'm trying to fetch only the entities which do not have an association (i.e. they have a NULL value in the database). This works exactly as I'd expect in dev move, but in prod mode, Doctrine throws an "unrecognized field" exception... for a field which absolutely does exist.</p>
  
  <p>Here's the relevant part of the entity in question (Page.php):</p>
  
  <pre><code>/**
   * @ORM\ManyToOne(targetEntity="Project", inversedBy="pages")
   * @ORM\JoinColumn(name="project_id", referencedColumnName="ID")
   */
  protected $project;
  </code></pre>
  
  <p>And here is the relevant line from the controller (PageController.php):</p>
  
  <pre><code>$pages = $this-&gt;getDoctrine()-&gt;getRepository('JCScopingBundle:Page')-&gt;findBy(['project' =&gt; null]);
  </code></pre>
  
  <p>Again, this works perfectly using app_dev.php (i.e. dev mode), but using app.php (i.e. prod mode) I keep getting the "unrecognized field" exception. What gives?</p>
  
  <p>Update: I added a "weight" integer field to the same entity and that field is not recognized in <code>prod</code> mode either. This means I can't use <code>prod</code> mode, which means I can't upload my changes to the remote server. Really in a pickle here...</p>