private function addStockPropertiesToQueryBuilder(
        QueryBuilder $queryBuilder,
        $useStock
    ) {
        if ($useStock) {
            $queryBuilder
                ->andWhere($queryBuilder->expr()->orX(
                    $queryBuilder->expr()->gt('p.stock', ':stockZero'),
                    $queryBuilder->expr()->eq('p.stock', ':infiniteStock')
                ))
                ->setParameter(
                    'stockZero',
                    0
                )
                ->setParameter(
                    'infiniteStock',
                    ElcodiProductStock::INFINITE_STOCK
                );
        }
    }