doctrine - Symfony - StateFieldPathExpression or SingleValuedAssociationField expected -
i use query builder of symfony , have query:
->select('partial detail.{id}') ->from('shopware\models\article\detail', 'detail') ->innerjoin('detail.attribute', 'attr') ->leftjoin('detail.article', 'article')
now have custom model outside of scope following relation:
class supplier { /** * @var \shopware\models\article\supplier * @orm\manytomany(targetentity="\shopware\models\article\supplier") * @orm\jointable(name="fp_demand_planning_supplier_manufacturers", joincolumns={@orm\joincolumn(name="supplier_id", referencedcolumnname="id")}, inversejoincolumns={@orm\joincolumn(name="manufacturer_id", referencedcolumnname="id", unique=true)}) */ private $manufacturers;
on article side model \shopware\models\article\supplier
stored in article.supplier
.
so want join custom model query above follows:
->select('partial detail.{id}') ->from('shopware\models\article\detail', 'detail') ->innerjoin('detail.attribute', 'attr') ->leftjoin('detail.article', 'article') ->innerjoin('fpdemandplanning\models\supplier', 'fps', 'with', 'article.supplier = fps.manufacturers');
here error:
206 near 'manufacturers': error: invalid pathexpression. statefieldpathexpression or singlevaluedassociationfield expected.
i tried way:
->innerjoin('fpdemandplanning\models\supplier', 'fps', 'with', 'article.supplier in (fps.manufacturers)');
but error:
[syntax error] line 0, col 216: error: expected literal, got 'fpsupplier' in
does know how can join custom model has many many relation here?
thanks!
Comments
Post a Comment