Doctrine entity custom getter
<p>How can I make this example happen? There is no relation between a Garage en red Cars. There is only a relation between a Garage en Cars.
I known I can use a repository for this, but in fact I want a getter in the Garage which will return only red cars. I assume DQL will be part of the awnser.</p>

<pre><code>$myFavoriteCars = $myGarage-&gt;getRedCars();

Garage.php:
---------------------------
@OneToMany(...Car...)
private $cars

public function getCars()
{
    return $this-&gt;cars;
}

public function getRedCars()
{
    // How to receive only the red cars?
    // Some DQL in here?
}


Car.php:
-------------------------
@ManyToOne(...Garage...)
private $garage

private $color
</code></pre>

<p>Thank you.
Richard</p>