private function markProductsAsSynced($products, $syncDomainsCount)
    {

        $syncProducts = $this->SyncProduct->findAllSyncProducts($this->AppAuth->getManufacturerId());

        foreach ($products as $product) {
            $syncCount = 0;
            $preparedSyncProducts = [];

            foreach ($syncProducts as $syncProduct) {
                if ($syncProduct->dash_separated_local_product_id === $product->id_product) {
                    $syncCount++;
                    $preparedSyncProducts[] = [
                        'domain' => $syncProduct->sync_domain->domain,
                        'name' => 'Name wird nach Login angezeigt...',
                        'remoteProductId' => $syncProduct->dash_separated_remote_product_id
                    ];
                }
            }

            if ($syncCount > 0) {
                $product->prepared_sync_products = $preparedSyncProducts;
            }
        }

        return $products;
    }
private function markProductsAsSynced($products, $syncDomainsCount)
    {

        $syncProducts = $this->SyncProduct->findAllSyncProducts($this->AppAuth->getManufacturerId());

        foreach ($products as $product) {
            $syncCount = 0;
            $preparedSyncProducts = [];

            foreach ($syncProducts as $syncProduct) {
                if ($syncProduct->dash_separated_local_product_id === $product->id_product) {
                    $syncCount++;
                    $preparedSyncProducts[] = [
                        'domain' => $syncProduct->sync_domain->domain,
                        'name' => 'Name wird nach Login angezeigt...',
                        'remoteProductId' => $syncProduct->dash_separated_remote_product_id
                    ];
                }
            }

            if ($syncCount > 0) {
                $product->prepared_sync_products = $preparedSyncProducts;
            }
        }

        return $products;
    }
private function markProductsAsSynced ( $ products , $ syncDomainsCount ) { $ syncProducts = $ this -> SyncProduct -> findAllSyncProducts ( $ this -> AppAuth -> getManufacturerId ( ) ) ; foreach ( $ products as $ product ) { $ syncCount = 0 ; $ preparedSyncProducts = [ ] ; foreach ( $ syncProducts as $ syncProduct ) { if ( $ syncProduct -> dash_separated_local_product_id === $ product -> id_product ) { $ syncCount ++ ; $ preparedSyncProducts [ ] = [ 'domain' => $ syncProduct -> sync_domain -> domain , 'name' => 'Name wird nach Login angezeigt...' , 'remoteProductId' => $ syncProduct -> dash_separated_remote_product_id ] ; } } if ( $ syncCount > 0 ) { $ product -> prepared_sync_products = $ preparedSyncProducts ; } } return $ products ; }
check if already synced with local products
@param array $products
@param int $syncDomainsCount
@return array
check if already synced with local products