Get jump clones and jump clone locations for a
character.

@param int $character_id

@return \Illuminate\Support\Collection
358470
public function getCharacterJumpClones(int $character_id): Collection
    {

        return DB::table(DB::raw(
            'character_jump_clones as a'))
            ->select(DB::raw('
                *, CASE
                when a.location_id BETWEEN 66015148 AND 66015151 then
                    (SELECT s.stationName FROM staStations AS s
                      WHERE s.stationID=a.location_id-6000000)
                when a.location_id BETWEEN 66000000 AND 66014933 then
                    (SELECT s.stationName FROM staStations AS s
                      WHERE s.stationID=a.location_id-6000001)
                when a.location_id BETWEEN 66014934 AND 67999999 then
                    (SELECT d.name FROM `sovereignty_structures` AS c
                      JOIN universe_stations d ON c.structure_id = d.station_id
                      WHERE c.structure_id=a.location_id-6000000)
                when a.location_id BETWEEN 60014861 AND 60014928 then
                    (SELECT d.name FROM `sovereignty_structures` AS c
                      JOIN universe_stations d ON c.structure_id = d.station_id
                      WHERE c.structure_id=a.location_id)
                when a.location_id BETWEEN 60000000 AND 61000000 then
                    (SELECT s.stationName FROM staStations AS s
                      WHERE s.stationID=a.location_id)
                when a.location_id>=61000000 then
                    (SELECT d.name FROM `sovereignty_structures` AS c
                      JOIN universe_stations d ON c.structure_id = d.station_id
                      WHERE c.structure_id=a.location_id)
                else (SELECT m.itemName FROM mapDenormalize AS m
                    WHERE m.itemID=a.location_id) end
                    AS location,a.location_id AS locID'))
            ->where('a.character_id', $character_id)
            ->get();
    }
317604
public function getContractsItemsData(int $character_id, int $contract_id)
    {

        $assets = $this->getCharacterContractsItems($character_id, $contract_id);

        return view('web::character.contractitems', compact('assets'));
    }
1166602
public function getCharacterUpcomingCalendarEvents(int $character_id): Collection
    {

        return CharacterCalendarEvent::with('detail', 'attendees')
            ->where('character_id', $character_id)
            ->whereDate('event_date', '>', carbon()->toDateTimeString())
            ->get();
    }
1150885
public function getCharacterSkillsInformation(int $character_id): Collection
    {

        return CharacterSkill::join('invTypes',
            'character_skills.skill_id', '=',
            'invTypes.typeID')
            ->join('invGroups', 'invTypes.groupID', '=', 'invGroups.groupID')
            ->where('character_skills.character_id', $character_id)
            ->orderBy('invTypes.typeName')
            ->get();

    }
772228
public function postUpdateNote(UpdateIntelNote $request, int $character_id)
    {

        CharacterInfo::updateNote(
            $character_id, $request->input('note_id'),
            $request->input('title'),
            $request->input('note'));

        return redirect()->back()
            ->with('success', 'Note updated!');

    }
678913
public function getCharacterList($charName, $page = 1)
    {
        $characterList = $this->gameDataService->getCharacterList($charName);

        return $this->getPaginator4QueryBuilder($characterList, $page);
    }
661720
public function getDocById($str_id)
    {
        $obj_request = new ListDocumentsRequest();
        $obj_params = $this->prepareRequestParams($obj_request);
        $obj_params->setStartDocId($str_id)->setLimit(1);
        $this->execute('ListDocuments', $obj_request, new ListDocumentsResponse());
        $obj_response = $this->processListResponse();

        // Verify that the document is the one we want and if not, empty the response
        // This works around the lack of a "get-by-id" method on the Google Protocol Buffer
        if($obj_response->count > 0) {
            if($str_id !== $obj_response->docs[0]->getId()) {
                $obj_response->count = 0;
                $obj_response->docs = [];
            }
        }
        return $obj_response;
    }
868543
public function getCharacterContacts(Collection $character_ids, array $standings): Builder
    {

        return CharacterContact::whereIn('character_contacts.character_id', $character_ids->toArray())
            ->whereIn('standing', $standings);
    }
183342
public function fetchPairs($key, $value = null){
		$clone = clone $this;

		// If executed w/o needed cols, force exec w/ them.
		if(!in_array('*', $clone->columns)){
			if($value !== null)
				$clone->columns = array($key, $value);
			elseif(!in_array($key, $clone->columns))
				$clone->columns[] = $key;
		}
		$k = substr($key, ($pk = strrpos($key, '.')) ? $pk+1 : 0);
		$v = $value === null ? null : substr($value, ($pv = strrpos($value, '.')) ? $pv+1 : 0);

		$rows = array();
		while($row = $clone->fetch()){
			if(!$row)
				return array();
			$rows[$row[$k]] = $value === null ? $row : $row->$v;
		}

		return $rows;
	}
446073
private function getUniverseNameResolved(int $character_id, int $first_party_id, int $second_party_id = null) : Collection
    {
        // f.e. market escrow -> self referential payment.
        if($first_party_id === $second_party_id)
            return collect([
                'character_id' => $character_id,
                'corporation_id' => CharacterInfo::find($character_id)->corporation_id,
                'alliance_id' => CharacterInfo::find($character_id)->alliance_id,
            ]);

        return collect([UniverseName::find($first_party_id), UniverseName::find($second_party_id)])
            ->filter()
            ->filter(function ($universe_name) use ($character_id) {

                return $universe_name->entity_id !== $character_id;
            })
            ->pipe(function ($collection) use ($character_id, $first_party_id,$second_party_id) {

                if ($collection->isNotEmpty()){

                    return $collection->flatten()->map(function ($item) {

                        if($item->category === 'character')
                            return collect([
                                'character_id' => $item->entity_id,
                                'corporation_id' => optional(CharacterAffiliation::find($item->entity_id))->corporation_id,
                                'alliance_id' => optional(CharacterAffiliation::find($item->entity_id))->alliance_id,
                            ])->filter();

                        if($item->category === 'corporation')
                            return collect([
                                'corporation_id' => $item->entity_id,
                                'alliance_id' => optional(CharacterAffiliation::where('corporation_id', $item->entity_id)->get()->first())->alliance_id,
                            ])->filter();

                        if($item->category === 'alliance')
                            return collect(['alliance_id' => $item->entity_id]);

                        return collect(['other_resolved_id' => $item->entity_id]);
                    })->filter();
                }

                return $collection->push(collect(['unknown_id' => $character_id !== $first_party_id ? $first_party_id : $second_party_id, 'character_id' => $character_id]));
            })
            ->flatMap(function ($value) {

                return $value;
            });
    }
1318677
public function getCharacterList($charName)
    {
        /** @var \GameBackend\Entity\CrossFire\Repository\Character $repository */
        $repository = $this->getAccountEntityManager()->getRepository($this->getGameOptions()->getEntityCharacterClass());
        return $repository->getCharacterList($charName);
    }
1363446
public function characterTopMailInteractions(Collection $character_ids) : Builder
    {

        return MailHeader::select()
            ->selectRaw('count(`from`) as total')
            ->whereIn('character_id', $character_ids->toArray())
            ->whereColumn('character_id', '<>', 'from')
            ->groupBy('from')
            ->orderBy('total', 'desc');

    }
306051
public function getCharacterIndustry(int $character_id, bool $get = true)
    {

        $industry = DB::table('character_industry_jobs as a')
            ->select(DB::raw('
                a.*,
                ramActivities.*,
                blueprintType.typeName as blueprintTypeName,
                productType.typeName as productTypeName,

                --
                -- Start Facility Name Lookup
                --
                CASE
                when a.station_id BETWEEN 66015148 AND 66015151 then
                    (SELECT s.stationName FROM staStations AS s
                      WHERE s.stationID = a.station_id-6000000)
                when a.station_id BETWEEN 66000000 AND 66014933 then
                    (SELECT s.stationName FROM staStations AS s
                      WHERE s.stationID = a.station_id-6000001)
                when a.station_id BETWEEN 66014934 AND 67999999 then
                    (SELECT d.name FROM `sovereignty_structures` AS c
                      JOIN universe_stations d ON c.structure_id = d.station_id
                      WHERE c.structure_id = a.station_id-6000000)
                when a.station_id BETWEEN 60014861 AND 60014928 then
                    (SELECT d.name FROM `sovereignty_structures` AS c
                      JOIN universe_stations d ON c.structure_id = d.station_id
                      WHERE c.structure_id = a.station_id)
                when a.station_id BETWEEN 60000000 AND 61000000 then
                    (SELECT s.stationName FROM staStations AS s
                      WHERE s.stationID = a.station_id)
                when a.station_id >= 61000000 then
                    (SELECT c.name FROM `universe_structures` AS c
                      WHERE c.structure_id = a.station_id)
                else (SELECT m.itemName FROM mapDenormalize AS m
                WHERE m.itemID = a.station_id) end
                AS facilityName'))
            ->leftJoin(
                'ramActivities',
                'ramActivities.activityID', '=',
                'a.activity_id')// character_industry_jobs aliased to a
            ->join(
                'invTypes as blueprintType',
                'blueprintType.typeID', '=',
                'a.blueprint_type_id'
            )
            ->join(
                'invTypes as productType',
                'productType.typeID', '=',
                'a.product_type_id'
            )
            ->where('a.character_id', $character_id);

        if ($get)
            return $industry->orderBy('end_date', 'desc')
                ->get();

        return $industry;

    }
1064097
public function getCharacterLedger(Collection $character_ids) : Builder
    {

        return CharacterMining::with('type', 'system')
            ->select(
                'character_minings.date',
                'character_minings.character_id',
                'solar_system_id',
                'character_minings.type_id',
                'historical_prices.adjusted_price')
            ->leftJoin('historical_prices', function ($join) {
                $join->on('historical_prices.type_id', '=', 'character_minings.type_id')
                     ->on('historical_prices.date', '=', 'character_minings.date');
            })
            ->whereIn('character_id', $character_ids->toArray());
    }
1093420
private function getCharacterIntelView(Collection $universe_name, int $character_id) : string
    {
        if ($universe_name->has('unknown_id'))
            return $this->getUnknownIntelView($universe_name);

        if (! $universe_name->has('character_id'))
            return '';

        $character = CharacterInfo::find($universe_name['character_id']) ?: $universe_name['character_id'];

        return view('web::partials.character', compact('character', 'character_id'));
    }
191651
public function AnimePictures(int $id): array
    {
        return $this->myanimelist->getAnimePictures(
            new Request\Anime\AnimePicturesRequest($id)
        );
    }
1323259
public function duplicate($id)
    {
        // Find the source item
        $src = $this->findOrFail($id);
        if (empty($src->cloneable)) {
            return App::abort(404);
        }

        // Duplicate using Bkwld\Cloner
        $new = $src->duplicate();

        // Don't make duplicates public
        if (array_key_exists('public', $new->getAttributes())) {
            $this->public = 0;
        }

        // If there is a name or title field, append " copy" to it.  Use "original"
        // to avoid mutators.
        if ($name = $new->getOriginal('name')) {
            $new->setAttribute('name', $name.' copy');
        } elseif ($title = $new->getOriginal('title')) {
            $new->setAttribute('title', $title.' copy');
        }

        // Set localization options on new instance
        if ($locale = request('locale')) {
            $new->locale = $locale;
            if (isset($src->locale_group)) {
                $new->locale_group = $src->locale_group;
            }
        }

        // Save any changes that were made
        $new->save();

        // Save the new record and redirect to its edit view
        return Redirect::to(DecoyURL::relative('edit', $new->getKey()))
            ->with('success', $this->successMessage($src, 'duplicated'));
    }