I try to run a query with Doctrine DQL in the repository and I get the following error:
QueryException in line QueryException.php 63: [Semantic error] line 0, col 100 next to 'test_suite_id': Error: class application \ model \ entity \ page does not have a field or association with the name test_suite_id
Associations
A Usermay have several TestSuites. A TestSuitemay have several Pages. As a result, I have a One-to-many relationship between Userand TestSuiteand TestSuiteand, Pagerespectively.

Here are my objects with only the relevant associations shown:
User
class User
{
private $testSuites = [];
}
Testsuite
class TestSuite
{
private $user;
private $pages = [];
}
Page
class Page
{
private $testSuite;
}
DQL Query Repository
public function findPageForUser(User $user, $pageId)
{
$qb = $this->getEntityManager()->createQueryBuilder();
$qb->add('select', 'p')
->from('Application\Model\Entity\Page', 'p')
->join('Application\Model\Entity\TestSuite', 'ts', 'WITH', 'p.test_suite_id = ts.id')
->join('Application\Model\Entity\User', 'u', 'WITH', 'ts.user_id = u.id')
->where('p.id = :pageId')
->andWhere('u = :user')
->setParameter('user', $user)
->setParameter('pageId', $pageId);
return $qb->getQuery()->getResult();
}
: User $pageId . , , , , .
, Page test_suite_id, id TestSuite, .
SELECT p FROM Application\Model\Entity\Page p INNER JOIN Application\Model\Entity\TestSuite ts WITH p.test_suite_id = ts.id \\\ u ts.user_id = u.id WHERE p.id =: pageId AND u =: user
:
- - .
- Apache -
- "Colum" "Column" - .
targetEntity - ,
, , ?