title: Doctrine ArrayCollection matching criteria function results in Undefined property: MyEntity::$1 (Symfony 3.4)
body: <p>I defined an Entity "TrainingProgressEntry" as an @ORM\Entity and a "training" property like this:</p>
  
  <pre><code>/**
   * @ORM\ManyToOne(targetEntity="Training", inversedBy="training_progress")
   * @ORM\JoinColumn(name="training_id", referencedColumnName="id")
   */
  protected $training;
  </code></pre>
  
  <p>The matching @ORM\Entity "Training" defines a property "training_progress" like</p>
  
  <pre><code>/**
   * @ORM\OneToMany(targetEntity="TrainingProgressEntry", mappedBy="training", cascade={"remove"})
   * @ORM\OrderBy({"entry_date" = "ASC"})
   */
  protected $training_progress;
  </code></pre>
  
  <p>and a getter method for it like this</p>
  
  <pre><code>/**
   * Get trainingProgress
   *
   * @return \Doctrine\Common\Collections\ArrayCollection
   */
  public function getTrainingProgress()
  {
      return $this-&gt;training_progress;
  }
  </code></pre>
  
  <p>Finaly I define a getter method intended to return only entries which have a date newer then some reference date:</p>
  
  <pre><code>/**
   * @return \Doctrine\Common\Collections\ArrayCollection
   */
  public function getTrainingProgressSinceStart()
  {
      $startTime = $this-&gt;getUser()-&gt;getStart();
      $criteria = Criteria::create()
          -&gt;andWhere(Criteria::expr()-&gt;gt('entry_date', $startTime))
          -&gt;orderBy(['entry_date', 'ASC']);
      return $this-&gt;getTrainingProgress()-&gt;matching($criteria);
  }
  </code></pre>
  
  <p>When using this last function I get the following "ContextErrorException":</p>
  
  <pre><code>Notice: Undefined property: AppBundle\Entity\TrainingProgressEntry::$1
  </code></pre>
  
  <p>coming from</p>
  
  <pre><code>vendor\doctrine\collections\lib\Doctrine\Common\Collections\Expr\ClosureExpressionVisitor.php
  </code></pre>
  
  <p>when trying to "return $object->$field".</p>
  
  <p>The trace shows that it is caused by the above mentioned function "getTrainingProgressSinceStart()" in the line</p>
  
  <pre><code>return $this-&gt;getTrainingProgress()-&gt;matching($criteria);
  </code></pre>
  
  <p>For some reason the matching function doesn't seem to be recognized ors something...
  I don't really know what to look for now.
  Any hints are very welcome.</p>