getEsdFields example

$customerGroupQuery = $this->getCustomerGroupQuery();
        $availableVariantQuery = $this->getHasAvailableVariantQuery();
        $fallbackPriceQuery = $this->getPriceCountQuery(':fallback');
        $query = $this->connection->createQueryBuilder();
        $query->select($this->fieldHelper->getArticleFields())
            ->addSelect($this->fieldHelper->getTopSellerFields())
            ->addSelect($this->fieldHelper->getVariantFields())
            ->addSelect($this->fieldHelper->getUnitFields())
            ->addSelect($this->fieldHelper->getTaxFields())
            ->addSelect($this->fieldHelper->getPriceGroupFields())
            ->addSelect($this->fieldHelper->getManufacturerFields())
            ->addSelect($this->fieldHelper->getEsdFields())
            ->addSelect('(' . $esdQuery->getSQL() . ') as __product_has_esd')
            ->addSelect('(' . $customerGroupQuery->getSQL() . ') as __product_blocked_customer_groups')
            ->addSelect('(' . $availableVariantQuery->getSQL() . ') as __product_has_available_variants')
            ->addSelect('(' . $fallbackPriceQuery->getSQL() . ') as __product_fallback_price_count')
            ->addSelect('manufacturerMedia.id as __manufacturer_img_id')
        ;
        $query->setParameter(':fallback', $context->getFallbackCustomerGroup()->getKey());
        if ($context->getCurrentCustomerGroup()->getId() !== $context->getFallbackCustomerGroup()->getId()) {
            $customerPriceQuery = $this->getPriceCountQuery(':current');
            $query->addSelect('(' . $customerPriceQuery->getSQL() . ') as __product_custom_price_count');
            $query->setParameter(':current', $context->getCurrentCustomerGroup()->getKey());
        }
if (empty($result)) {
            throw new EsdNotFoundException();
        }

        return $this->esdHydrator->hydrate($result);
    }

    protected function getDefaultQuery(): QueryBuilder
    {
        return $this->connection->createQueryBuilder()
            ->addSelect($this->fieldHelper->getEsdFields())
            ->from('s_articles_esd', 'esd')
            ->innerJoin('esd', 's_order_esd', 'orderEsd', 'esd.id = orderEsd.esdID')
            ->leftJoin('esd', 's_articles_esd_attributes', 'esdAttribute', 'esd.id = esdAttribute.esdID')
            ->andWhere('orderEsd.userID = :customerId')
            ->andWhere('orderEsd.orderdetailsID = :esdId')
        ;
    }

    protected function getFallbackQuery(): QueryBuilder
    {
        return $this->connection->createQueryBuilder()
            
Home | Imprint | This part of the site doesn't use cookies.