public function addAccountPurchases($accountPurchases)
    {
        if (!$accountPurchases) {
            return;
        }

        foreach ($accountPurchases as $accountPurchase) {
            $accountId = $accountPurchase['account']['id'];

            if (!array_key_exists($accountId, $this->customerSupplierItems)) {
                continue;
            }

            $customerData = [];
            if (isset($accountPurchase['avisoContact'])) {
                $customerData['avisoContact'] = $accountPurchase['avisoContact'];
            }
            if (isset($accountPurchase['contact'])) {
                $customerData['contact'] = $accountPurchase['contact'];
            }

            // Add customer data
            $this->customerSupplierItems[$accountId] = $this->customerSupplierItems[$accountId] + $customerData;
        }
    }
public function addAccountPurchases($accountPurchases)
    {
        if (!$accountPurchases) {
            return;
        }

        foreach ($accountPurchases as $accountPurchase) {
            $accountId = $accountPurchase['account']['id'];

            if (!array_key_exists($accountId, $this->customerSupplierItems)) {
                continue;
            }

            $customerData = [];
            if (isset($accountPurchase['avisoContact'])) {
                $customerData['avisoContact'] = $accountPurchase['avisoContact'];
            }
            if (isset($accountPurchase['contact'])) {
                $customerData['contact'] = $accountPurchase['contact'];
            }

            // Add customer data
            $this->customerSupplierItems[$accountId] = $this->customerSupplierItems[$accountId] + $customerData;
        }
    }
public function addAccountPurchases ( $ accountPurchases ) { if ( ! $ accountPurchases ) { return ; } foreach ( $ accountPurchases as $ accountPurchase ) { $ accountId = $ accountPurchase [ 'account' ] [ 'id' ] ; if ( ! array_key_exists ( $ accountId , $ this -> customerSupplierItems ) ) { continue ; } $ customerData = [ ] ; if ( isset ( $ accountPurchase [ 'avisoContact' ] ) ) { $ customerData [ 'avisoContact' ] = $ accountPurchase [ 'avisoContact' ] ; } if ( isset ( $ accountPurchase [ 'contact' ] ) ) { $ customerData [ 'contact' ] = $ accountPurchase [ 'contact' ] ; } // Add customer data $ this -> customerSupplierItems [ $ accountId ] = $ this -> customerSupplierItems [ $ accountId ] + $ customerData ; } }
Adds extra customer data to customerSupplierItems.

@param array $accountPurchases
Adds extra customer data to customerSupplierItems .