protected function getCartProductInCart(CartProductInterface $cartProduct, CartInterface $cart)
    {
        return $this->getRepository()->findOneBy([
            'id'   => $cartProduct->getId(),
            'cart' => $cart
        ]);
    }
protected function getCartProductInCart(CartProductInterface $cartProduct, CartInterface $cart)
    {
        return $this->getRepository()->findOneBy([
            'id'   => $cartProduct->getId(),
            'cart' => $cart
        ]);
    }
protected function getCartProductInCart ( CartProductInterface $ cartProduct , CartInterface $ cart ) { return $ this -> getRepository ( ) -> findOneBy ( [ 'id' => $ cartProduct -> getId ( ) , 'cart' => $ cart ] ) ; }
Returns an item from cart

@param CartProductInterface $cartProduct
@param CartInterface        $cart

@return null|CartProductInterface
Returns an item from cart