@param \Interpro\Extractor\Contracts\Db\CMapper

@return void
1998
public function registerCMapper(CMapper $mapper)
    {
        $family = $mapper->getFamily();

        if(array_key_exists($family, $this->mappersC))
        {
            throw new ExtractorException('Маппер простых(С) типов пакета '.$family.' уже зарегестрирована в медиаторе!');
        }

        $this->mappersC[$family] = $mapper;
    }
1106869
public function run()
    {
        if (!App::environment('testing')) {
            DB::statement('SET FOREIGN_KEY_CHECKS=0');
        }
        DB::table(config('combine-core.tablePrefix', 'combine') . '_addresses')->truncate();
        DB::table(config('combine-core.tablePrefix', 'combine') . '_notes')->truncate();
        DB::table(config('combine-core.tablePrefix', 'combine') . '_phones')->truncate();
        DB::table('users')->truncate();
        if (!App::environment('testing')) {
            DB::statement('SET FOREIGN_KEY_CHECKS=1');
        }
    }
858506
protected function job(): void
    {
        while (true) {

            $industry_jobs = $this->retrieve([
                'corporation_id' => $this->getCorporationId(),
            ]);

            if ($industry_jobs->isCachedLoad()) return;

            collect($industry_jobs)->each(function ($job) {

                CorporationIndustryJob::firstOrNew([
                    'corporation_id' => $this->getCorporationId(),
                    'job_id'         => $job->job_id,
                ])->fill([
                    'installer_id'           => $job->installer_id,
                    'facility_id'            => $job->facility_id,
                    'location_id'            => $job->location_id,
                    'activity_id'            => $job->activity_id,
                    'blueprint_id'           => $job->blueprint_id,
                    'blueprint_type_id'      => $job->blueprint_type_id,
                    'blueprint_location_id'  => $job->blueprint_location_id,
                    'output_location_id'     => $job->output_location_id,
                    'runs'                   => $job->runs,
                    'cost'                   => $job->cost ?? null,
                    'licensed_runs'          => $job->licensed_runs ?? null,
                    'probability'            => $job->probability ?? null,
                    'product_type_id'        => $job->product_type_id ?? null,
                    'status'                 => $job->status,
                    'duration'               => $job->duration,
                    'start_date'             => carbon($job->start_date),
                    'end_date'               => carbon($job->end_date),
                    'pause_date'             => property_exists($job, 'pause_date') ?
                        carbon($job->pause_date) : null,
                    'completed_date'         => property_exists($job, 'completed_date') ?
                        carbon($job->completed_date) : null,
                    'completed_character_id' => $job->completed_character_id ?? null,
                    'successful_runs'        => $job->successful_runs ?? null,
                ])->save();
            });

            if (! $this->nextPage($industry_jobs->pages))
                return;
        }
    }
1304040
protected function job(): void
    {
        $members = $this->retrieve([
            'corporation_id' => $this->getCorporationId(),
        ]);

        if ($members->isCachedLoad()) return;

        collect($members)->each(function ($member) {

            CorporationMemberTracking::firstOrNew([
                'corporation_id' => $this->getCorporationId(),
                'character_id'   => $member->character_id,
            ])->fill([
                'start_date'   => property_exists($member, 'start_date') ?
                    carbon($member->start_date) : null,
                'base_id'      => $member->base_id ?? null,
                'logon_date'   => property_exists($member, 'logon_date') ?
                    carbon($member->logon_date) : null,
                'logoff_date'  => property_exists($member, 'logoff_date') ?
                    carbon($member->logoff_date) : null,
                'location_id'  => $member->location_id ?? null,
                'ship_type_id' => $member->ship_type_id ?? null,
            ])->save();
        });

        CorporationMemberTracking::where('corporation_id', $this->getCorporationId())
            ->whereNotIn('character_id', collect($members)->pluck('character_id')->all())
            ->delete();
    }
1118140
public function analyzeMap(): void
    {
        $this->analyzeDuplicates('source', $this->sourceLanguage, $this->sourceMap, $this->sourceMapInverse);
        $this->analyzeDuplicates('target', $this->targetLanguage, $this->targetMap, $this->targetMapInverse);

        foreach ($this->targetMap as $targetId => $mainId) {
            if (!array_key_exists($mainId, $this->sourceMapInverse)) {
                $this->logger->warning(
                    'No source for target found. ' .
                    '{targetLanguage}: {targetId} => {mainLanguage}: {mainId} <= {sourceLanguage}: ?',
                    [
                        'sourceLanguage' => $this->sourceLanguage,
                        'mainLanguage'   => $this->mainLanguage,
                        'targetLanguage' => $this->targetLanguage,
                        'targetId'       => $targetId,
                        'mainId'         => $mainId,
                        'msg_type'       => 'no_source_for_target',
                        'class'          => \get_class($this),
                    ]
                );
            }
        }
    }
1147252
public function doInstall(): void
	{
		ModuleManager::registerModule($this->MODULE_ID);
		$this->installDB();
		$this->installFiles();
	}
907773
public function cmdGetCache()
    {
        $id = $this->getParam(0);

        if (empty($id)) {
            $this->errorAndExit($this->text('Invalid command'));
        }

        $result = $this->cache->get($id);

        if (!isset($result)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        $this->outputFormat($result, 'json');
        $this->output();
    }
865049
protected function job(): void
    {
        // Get the assets for this character, chunked in a number of blocks
        // that the endpoint will accept.
        CorporationAsset::join('invTypes', 'type_id', '=', 'typeID')
            ->join('invGroups', 'invGroups.groupID', '=', 'invTypes.groupID')
            ->where('corporation_id', $this->getCorporationId())
            ->where('is_singleton', true)// only singleton items may be named
            // it seems only items from that categories can be named
            // 2  : Celestial
            // 6  : Ship
            // 22 : Deployable
            // 23 : Starbase
            // 46 : Orbitals
            // 65 : Structure
            ->whereIn('categoryID', [2, 6, 22, 23, 46, 65])// it seems only items from that categories can be named
            ->select('item_id')
            ->chunk($this->item_id_limit, function ($item_ids) {

                $this->request_body = $item_ids->pluck('item_id')->all();

                $names = $this->retrieve([
                    'corporation_id' => $this->getCorporationId(),
                ]);

                collect($names)->each(function ($name) {

                    // "None" seems to indidate that no name is set.
                    if ($name->name === 'None')
                        return;

                    CorporationAsset::where('corporation_id', $this->getCorporationId())
                        ->where('item_id', $name->item_id)
                        ->update(['name' => $name->name]);
                });
            });
    }
1339318
protected function job(): void
    {
        $unfinished_auctions = CorporationContract::join('contract_details',
            'corporation_contracts.contract_id', '=',
            'contract_details.contract_id')
            ->where('corporation_id', $this->getCorporationId())
            ->where('type', 'auction')
            ->whereNotIn('status', ['finished', 'deleted'])
            ->pluck('corporation_contracts.contract_id');

        $unfinished_auctions->each(function ($contract_id) {

            while (true) {

                try {
                    $bids = $this->retrieve([
                        'corporation_id' => $this->getCorporationId(),
                        'contract_id'    => $contract_id,
                    ]);

                    if ($bids->isCachedLoad()) return;

                    collect($bids)->each(function ($bid) use ($contract_id) {

                        ContractBid::firstOrCreate([
                            'bid_id' => $bid->bid_id,
                        ], [
                            'contract_id' => $contract_id,
                            'bidder_id' => $bid->bidder_id,
                            'date_bid' => carbon($bid->date_bid),
                            'amount' => $bid->amount,
                        ]);
                    });

                    if (! $this->nextPage($bids->pages))
                        break;

                } catch (RequestFailedException $e) {
                    if (strtolower($e->getError()) == 'contract not found') {
                        ContractDetail::where('contract_id', $contract_id)
                            ->update([
                                'status' => 'deleted',
                            ]);

                        break;
                    }

                    throw $e;
                }
            }

            // reset the page back to page one for the next contract
            $this->page = 1;
        });
    }
1285564
public function run()
    {
        $table = $this->table(CMS_TABLE_GROUPS);
        $table->insert($this->records)->save();
    }
846689
private function resolveHelpers()
    {

        if (count($helpers = Arr::get($this->getGeneral(), 'helpers', []))) {

            foreach ($helpers as $helper) {
                if (file_exists($helper)) {
                    include $helper;
                }
            }

        }

    }
877359
protected function job(): void
    {
        $limit = $this->retrieve([
            'corporation_id' => $this->getCorporationId(),
        ]);

        if ($limit->isCachedLoad()) return;

        if (! property_exists($limit, 'scalar'))
            return;

        CorporationMemberLimits::firstOrNew([
            'corporation_id' => $this->getCorporationId(),
        ])->fill([
            'limit' => $limit->scalar,
        ])->save();
    }
661147
protected function job(): void
    {
        CorporationStarbase::where('corporation_id', $this->getCorporationId())
            ->get()->each(function ($starbase) {

                $this->query_string = [
                    'system_id' => $starbase->system_id,
                ];

                $detail = $this->retrieve([
                    'corporation_id' => $this->getCorporationId(),
                    'starbase_id'    => $starbase->starbase_id,
                ]);

                CorporationStarbaseDetail::firstOrNew([
                    'corporation_id' => $this->getCorporationId(),
                    'starbase_id'    => $starbase->starbase_id,
                ])->fill([
                    'fuel_bay_view'                            => $detail->fuel_bay_view,
                    'fuel_bay_take'                            => $detail->fuel_bay_take,
                    'anchor'                                   => $detail->anchor,
                    'unanchor'                                 => $detail->unanchor,
                    'online'                                   => $detail->online,
                    'offline'                                  => $detail->offline,
                    'allow_corporation_members'                => $detail->allow_corporation_members,
                    'allow_alliance_members'                   => $detail->allow_alliance_members,
                    'use_alliance_standings'                   => $detail->use_alliance_standings,
                    'attack_standing_threshold'                => $detail->attack_standing_threshold ?? null,
                    'attack_security_status_threshold'         => $detail->attack_security_status_threshold ?? null,
                    'attack_if_other_security_status_dropping' => $detail->attack_if_other_security_status_dropping,
                    'attack_if_at_war'                         => $detail->attack_if_at_war,
                ])->save();

                if (property_exists($detail, 'fuels'))

                    collect($detail->fuels)->each(function ($fuel) use ($starbase) {

                        CorporationStarbaseFuel::firstOrNew([
                            'corporation_id' => $this->getCorporationId(),
                            'starbase_id'    => $starbase->starbase_id,
                            'type_id'        => $fuel->type_id,
                        ])->fill([
                            'quantity' => $fuel->quantity,
                        ])->save();

                    });

                $this->known_starbases->push($starbase->starbase_id);

            });

        CorporationStarbaseDetail::where('corporation_id', $this->getCorporationId())
            ->whereNotIn('starbase_id', $this->known_starbases->flatten()->all())
            ->delete();

        CorporationStarbaseFuel::where('corporation_id', $this->getCorporationId())
            ->whereNotIn('starbase_id', $this->known_starbases->flatten()->all())
            ->delete();
    }
112869
protected function job(): void
    {
        while (true) {

            $medals = $this->retrieve([
                'corporation_id' => $this->getCorporationId(),
            ]);

            if ($medals->isCachedLoad()) return;

            collect($medals)->each(function ($medal) {

                CorporationIssuedMedal::firstOrNew([
                    'corporation_id' => $this->getCorporationId(),
                    'medal_id'       => $medal->medal_id,
                    'character_id'   => $medal->character_id,
                ])->fill([
                    'reason'    => $medal->reason,
                    'status'    => $medal->status,
                    'issuer_id' => $medal->issuer_id,
                    'issued_at' => carbon($medal->issued_at),
                ])->save();

            });

            if (! $this->nextPage($medals->pages))
                break;
        }
    }
84741
protected function job(): void
    {
        while (true) {

            $customs_offices = $this->retrieve([
                'corporation_id' => $this->getCorporationId(),
            ]);

            if ($customs_offices->isCachedLoad()) return;

            collect($customs_offices)->each(function ($customs_office) {

                CorporationCustomsOffice::firstOrNew([
                    'corporation_id' => $this->getCorporationId(),
                    'office_id'      => $customs_office->office_id,
                ])->fill([
                    'system_id'                   => $customs_office->system_id,
                    'reinforce_exit_start'        => $customs_office->reinforce_exit_start,
                    'reinforce_exit_end'          => $customs_office->reinforce_exit_end,
                    'corporation_tax_rate'        => $customs_office->corporation_tax_rate ?? null,
                    'allow_alliance_access'       => $customs_office->allow_alliance_access,
                    'alliance_tax_rate'           => $customs_office->alliance_tax_rate ?? null,
                    'allow_access_with_standings' => $customs_office->allow_access_with_standings,
                    'standing_level'              => $customs_office->standing_level ?? null,
                    'excellent_standing_tax_rate' => $customs_office->excellent_standing_tax_rate ?? null,
                    'good_standing_tax_rate'      => $customs_office->good_standing_tax_rate ?? null,
                    'neutral_standing_tax_rate'   => $customs_office->neutral_standing_tax_rate ?? null,
                    'bad_standing_tax_rate'       => $customs_office->bad_standing_tax_rate ?? null,
                    'terrible_standing_tax_rate'  => $customs_office->terrible_standing_tax_rate ?? null,
                ])->save();

                $this->known_structures->push($customs_office->office_id);

            });

            if (! $this->nextPage($customs_offices->pages))
                break;
        }

        // Cleanup customs offices that were not in the response.
        CorporationCustomsOffice::where('corporation_id', $this->getCorporationId())
            ->whereNotIn('office_id', $this->known_structures->flatten()->all())
            ->delete();
    }
295344
protected function job(): void
    {
        $corporation = $this->retrieve([
            'corporation_id' => $this->getCorporationId(),
        ]);

        if ($corporation->isCachedLoad()) return;

        CorporationInfo::firstOrNew([
            'corporation_id' => $this->getCorporationId(),
        ])->fill([
            'name'            => $corporation->name,
            'ticker'          => $corporation->ticker,
            'member_count'    => $corporation->member_count,
            'ceo_id'          => $corporation->ceo_id,
            'alliance_id'     => $corporation->alliance_id ?? null,
            'description'     => $corporation->description ?? null,
            'tax_rate'        => $corporation->tax_rate,
            'date_founded'    => property_exists($corporation, 'date_founded') ?
                carbon($corporation->date_founded) : null,
            'creator_id'      => $corporation->creator_id,
            'url'             => $corporation->url ?? null,
            'faction_id'      => $corporation->faction_id ?? null,
            'home_station_id' => $corporation->home_station_id ?? null,
            'shares'          => $corporation->shares ?? null,
        ])->save();
    }
755843
public function handle(): void
    {
        $this->dbMigrate();
        $this->populateReactionTypes();
        $this->populateReacters();
        $this->populateReactants();
        $this->populateReactions();
        $this->dbCleanup();
        $this->filesystemCleanup();
    }