public function findAllCartsWithAddress(AddressInterface $address)
    {
        $queryBuilder = $this
            ->createQueryBuilder('c');

        $result = $queryBuilder
            ->innerJoin('c.billingAddress', 'b')
            ->innerJoin('c.deliveryAddress', 'd')
            ->where(
                $queryBuilder->expr()->orX(
                    $queryBuilder->expr()->eq('b.id', ':customerId'),
                    $queryBuilder->expr()->eq('c.id', ':addressId')
                )
            )
            ->setParameter('customerId', $address->getId())
            ->setParameter('addressId', $address->getId())
            ->getQuery()
            ->getResult();

        return $result;
    }
public function findAllCartsWithAddress(AddressInterface $address)
    {
        $queryBuilder = $this
            ->createQueryBuilder('c');

        $result = $queryBuilder
            ->innerJoin('c.billingAddress', 'b')
            ->innerJoin('c.deliveryAddress', 'd')
            ->where(
                $queryBuilder->expr()->orX(
                    $queryBuilder->expr()->eq('b.id', ':customerId'),
                    $queryBuilder->expr()->eq('c.id', ':addressId')
                )
            )
            ->setParameter('customerId', $address->getId())
            ->setParameter('addressId', $address->getId())
            ->getQuery()
            ->getResult();

        return $result;
    }
public function findAllCartsWithAddress ( AddressInterface $ address ) { $ queryBuilder = $ this -> createQueryBuilder ( 'c' ) ; $ result = $ queryBuilder -> innerJoin ( 'c.billingAddress' , 'b' ) -> innerJoin ( 'c.deliveryAddress' , 'd' ) -> where ( $ queryBuilder -> expr ( ) -> orX ( $ queryBuilder -> expr ( ) -> eq ( 'b.id' , ':customerId' ) , $ queryBuilder -> expr ( ) -> eq ( 'c.id' , ':addressId' ) ) ) -> setParameter ( 'customerId' , $ address -> getId ( ) ) -> setParameter ( 'addressId' , $ address -> getId ( ) ) -> getQuery ( ) -> getResult ( ) ; return $ result ; }
Finds all the carts that had an address for billing or delivery.

@param AddressInterface $address The address to search

@return CartInterface[]
Finds all the carts that had an address for billing or delivery .