I have the following query. The query is inside my InstagramShopPicture
$queryBuilder = $this->createQueryBuilder('p')
->select('p.id, p.caption, p.price, p.lowresimageurl, p.medresimageurl, p.highresimageurl, p.numberoflikes, p.numberofdislikes, shop.id, shop.username, shop.fullname, contact, category')
->leftJoin('p.shop', 'shop')
->leftJoin('shop.contact', 'contact')
->leftJoin('p.category', 'category')
->leftJoin('category.pictureTopCategory', 'pictureTopCategory')
->leftJoin('category.pictureFirstLevelCategory', 'pictureFirstLevelCategory')
->leftJoin('category.pictureSecondLevelCategory', 'pictureSecondLevelCategory')
->where('p.isLocked = false')
->andWhere('p.isStyleInspiration = false')
->andWhere('shop.isLocked = false');
I am however getting the following error:
QueryException: [Semantical Error] line 0, col -1 near 'SELECT p.id,': Error: Cannot select entity through identification variables without choosing at least one root entity alias
any idea on how to solve this?