i ve searched for 2 days for an answer but i can't find it, please help me guys ! :)
I Have this :
In Entity Bon:
/**
* $entreprise.
*
*
*
* @ORM\ManyToOne(targetEntity="Soraya\UserBundle\Entity\Entreprise", inversedBy="bons")
* @ORM\JoinColumn(name="entreprise_id", referencedColumnName="id")
*/
private $entreprise;
And this in entity Entreprise :
/**
* $bons.
*
* @ORM\OneToMany(targetEntity="Soraya\BonBundle\Entity\Bon", mappedBy="entreprise")
*/
protected $bons;
And here is my repo function:
public function getEntrepriseBons($entreprise, $container = null)
{
if ($container === null) {
return null;
}
$queryBuilder = $this->_em->createQueryBuilder()
->select('bon')
->from('Soraya\BonBundle\Entity\Bon', 'bon')
->where('bon.entreprise = :entreprise')
->andWhere('bon.isDeleted = 0')
->setParameters(array('entreprise' => $entreprise,));
return $queryBuilder->getQuery()->getResult();
}
And here is the error by Symfony :
[Semantical Error] line 0, col 58 near 'entreprise =': Error: Class Soraya\BonBundle\Entity\Bon has no field or association named entreprise
I have all getters and setters implemented in both classes, i updated entities (doctrine:schema:update).
I looked everywhere and all responses in other threads like this one, didnt helped me. what am i missing here ? Thank you guys!