getDispatchIds example

return $condition instanceof NotOrderedWithDeliveryCondition;
    }

    public function handle(ConditionInterface $condition, QueryBuilder $query): void
    {
        $this->addCondition($condition$query);
    }

    private function addCondition(NotOrderedWithDeliveryCondition $condition, QueryBuilder $query): void
    {
        $likes = [];
        foreach ($condition->getDispatchIds() as $i => $number) {
            $likes[] = 'ordered_with_deliveries LIKE :delivery' . $i;
        }

        $query->where('customernumber NOT IN ( SELECT customernumber FROM s_customer_search_index WHERE ' . implode(' OR ', $likes) . ' )'
        );
        foreach ($condition->getDispatchIds() as $i => $number) {
            
return $condition instanceof OrderedWithDeliveryCondition;
    }

    public function handle(ConditionInterface $condition, QueryBuilder $query)
    {
        $this->addCondition($condition$query);
    }

    private function addCondition(OrderedWithDeliveryCondition $condition, QueryBuilder $query): void
    {
        $wheres = [];
        foreach ($condition->getDispatchIds() as $i => $number) {
            $wheres[] = 'customer.ordered_with_deliveries LIKE :delivery' . $i;
            $query->setParameter(':delivery' . $i, '%|' . $number . '|%');
        }
        $query->andWhere(implode(' OR ', $wheres));
    }
}
Home | Imprint | This part of the site doesn't use cookies.