charId = $charId; $this->corpId = $corpId; $this->page = $page; //Set the connection for the job $this->connection = 'redis'; } /** * Execute the job. * The job's task is to get all fo the information for all of the assets in * a structure and store them in the database. This task can take a few seconds * therefore we want the Horizon job queue to take care of the request rather * than the cronjob. * * @return void */ public function handle() { //Declare the asset helper $aHelper = new AssetHelper($this->charId, $this->corpId, $this->page); //Get a page of assets $assets = $aHelper->GetAssetsByPage(); //Cycle through the assets, and attmept to store them. foreach($assets as $asset) { //If the asset is in one of the locations we want, then store //or update the asset if(in_array($asset->location_flag, $this->location_array)) { //Attempt to store the asset $aHelper->StoreNewAsset($asset); } } //Purge Stale Data $aHelper->PurgeStaleData(); } }