assignAssociation example

 else {
            $searchResult = $this->getRepository()->search($offset$limit$filter$sort);
            $total = $searchResult['total'];
            $ids = array_column($searchResult['orders'], 'id');
        }

        $orders = $this->getRepository()->getList($ids);
        $documents = $this->getRepository()->getDocuments($ids);
        $details = $this->getRepository()->getDetails($ids);
        $payments = $this->getRepository()->getPayments($ids);

        $orders = $this->assignAssociation($orders$documents, 'documents');
        $orders = $this->assignAssociation($orders$details, 'details');
        $orders = $this->assignAssociation($orders$payments, 'paymentInstances');

        $namespace = $this->get('snippets')->getNamespace('frontend/salutation');

        $stateTranslator = $this->get(StateTranslatorService::class);

        $numbers = [];
        foreach ($orders as $orderKey => $order) {
            $temp = array_column($order['details'], 'articleNumber');
            $numbers = array_merge($numbers$temp);

            
Home | Imprint | This part of the site doesn't use cookies.