I'm using createQueryBuilder to create a query like this
$result = $qb->select('csr.id,csr.survey')
->from('Entity\ClientSurveyRecord', 'csr')
->innerJoin('Entity\AbstractClientRecord','cr','WITH','cr.id = csr.id')
->innerJoin('Entity\Client','c','WITH','cr.client = c.id')
->where('csr.survey = :id_survey')
->setParameter('id_survey',$id)
->getQuery()
->getResult();
And I get the following message Type: Doctrine\ORM\Query\QueryException
Message: [Semantical Error] line 0, col 18 near 'survey FROM Entity\ClientSurveyRecord': Error: Invalid PathExpression. Must be a StateFieldPathExpression.
Filename: /var/www/vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php
But if I change $qb->select('csr.id,csr.survey')
for $qb->select('csr.id')
it works
this is the mapping file
Entity\ClientSurveyRecord:
type: entity
table: clients_survey_records
fields:
result:
type: integer
column: result
nullable: false
options:
comment: Client survey current result.
manyToOne:
survey:
targetEntity: Entity\AbstractSurvey
joinColumn:
name: id_survey
referenceColumnName: id
nullable: false
surveyShipmentTracking:
targetEntity: Entity\SurveyShipmentTracking
joinColumn:
name: id_survey_shipment_tracking
referenceColumnName: id
nullable: false