app/Http/Controllers/BrightpearlController.php
// This method is used to get all large data sets. This calls after preInitialSync done.
This method is used to get all large data sets. This calls after preInitialSync done.
This method is used to get all large data sets . This calls after preInitialSync done .
public function bpFetchUserInitialData($user_id){ 
			set_time_limit(0);
			$this->BpApi->initialSyncExistingProductsBP($user_id);  
			$pending_uris = $this->obj->getCountsByConditions('brightpearl_urls', ['organization_id'=>$user_id, 'status'=>0]); 
			if($pending_uris == 0){
				$this->obj->makeUpdate('api_config',['sync_completed' => 1, 'sync_ac' => 0],['organization_id'=>$user_id,'api_provider'=>'brightpearl']); 
			}else{
				$this->obj->makeUpdate('api_config',['sync_ac' => 1],['organization_id'=>$user_id,'api_provider'=>'brightpearl']);
			}
		}
public function bpFetchUserInitialData ( $ user_id ) { set_time_limit ( 0 ) ; $ this -> BpApi -> initialSyncExistingProductsBP ( $ user_id ) ; $ pending_uris = $ this -> obj -> getCountsByConditions ( 'brightpearl_urls' , [ 'organization_id' => $ user_id , 'status' => 0 ] ) ; if ( $ pending_uris == 0 ) { $ this -> obj -> makeUpdate ( 'api_config' , [ 'sync_completed' => 1 , 'sync_ac' => 0 ] , [ 'organization_id' => $ user_id , 'api_provider' => 'brightpearl' ] ) ; } else { $ this -> obj -> makeUpdate ( 'api_config' , [ 'sync_ac' => 1 ] , [ 'organization_id' => $ user_id , 'api_provider' => 'brightpearl' ] ) ; } }
This method is used to get all large data sets.
This method is used to get all large data sets .
// BP initial fetch in parts // Product & Custom order fields metadata // Check whether all uri are processed or not. Status 0 means not processed. // If no uri are pending to process then update as sync is completed // Updating price flag to updated // If got pending uri then reset sync_ac as 1 to restart initial sync from cron