This is a very basic quesiton about Doctrine. How are single quotes escaped?
For example, title needs to be escaped as it contains a single quote:
$query = $this->entityManager->
createQuery("SELECT p from \RTH\Entity\Prod p
JOIN p.prodns ps
JOIN ps.events e
WHERE p.title = '" . $title . "'");
Is there a specific way to do this in Doctrine 2?
Try using prepared statements http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/data-retrieval-and-manipulation.html#using-prepared-statements