I have the following query:
$em = $this->getEntityManager();
$query = $em->createQueryBuilder()->select('shoppingcart')
->from("AppMainBundle:ShoppingCart", 'shoppingcart')
->innerJoin('shoppingcart.shoppingCartProducts', 'shoppingcartproduct')
->innerJoin('shoppingcartproduct.product', 'product')
->innerJoin('shoppingcartproduct.productAttribute', 'productattribute')
->innerJoin('product.shop', 'shop')
;
how do I write a where statement, where I only want to get shoppingcart that has more than one shoppingcartproduct in it? Here's the relationship of shopping cart and shoppingcart product:
class ShoppingCart
{
/**
* @var integer $id
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\OneToMany(targetEntity="ShoppingCartProduct", mappedBy="shoppingCart", cascade={"persist","remove"})
*/
protected $shoppingCartProducts;
}