public function findCartItem(CartEvent $event)
    {
        // Do not try to find a cartItem if one exists in the event, as previous event handlers
        // mays have put it in th event.
        if (null === $event->getCartItem() && null !== $foundItem = CartItemQuery::create()
            ->filterByCartId($event->getCart()->getId())
            ->filterByProductId($event->getProduct())
            ->filterByProductSaleElementsId($event->getProductSaleElementsId())
            ->findOne()) {
            $event->setCartItem($foundItem);
        }
    }
public function findCartItem(CartEvent $event)
    {
        // Do not try to find a cartItem if one exists in the event, as previous event handlers
        // mays have put it in th event.
        if (null === $event->getCartItem() && null !== $foundItem = CartItemQuery::create()
            ->filterByCartId($event->getCart()->getId())
            ->filterByProductId($event->getProduct())
            ->filterByProductSaleElementsId($event->getProductSaleElementsId())
            ->findOne()) {
            $event->setCartItem($foundItem);
        }
    }
public function findCartItem ( CartEvent $ event ) { // Do not try to find a cartItem if one exists in the event, as previous event handlers // mays have put it in th event. if ( null === $ event -> getCartItem ( ) && null !== $ foundItem = CartItemQuery :: create ( ) -> filterByCartId ( $ event -> getCart ( ) -> getId ( ) ) -> filterByProductId ( $ event -> getProduct ( ) ) -> filterByProductSaleElementsId ( $ event -> getProductSaleElementsId ( ) ) -> findOne ( ) ) { $ event -> setCartItem ( $ foundItem ) ; } }
Find a specific record in CartItem table using the current CartEvent

@param CartEvent $event the cart event
Find a specific record in CartItem table using the current CartEvent