Return the assets list for a Corporation.

@param int $corporation_id

@return \Illuminate\Support\Collection
552407
public function getCorporationAssets(int $corporation_id): Collection
    {

        return CorporationAsset::with('content', 'type')
            ->select(DB::raw('
                --
                -- Select All Fields
                --
                *,

                --
                -- Start the location lookup
                --
                CASE
                when corporation_assets.location_id BETWEEN 66015148 AND 66015151 then
                    (SELECT s.stationName FROM staStations AS s
                      WHERE s.stationID=corporation_assets.location_id-6000000)
                when corporation_assets.location_id BETWEEN 66000000 AND 66014933 then
                    (SELECT s.stationName FROM staStations AS s
                      WHERE s.stationID=corporation_assets.location_id-6000001)
                when corporation_assets.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=corporation_assets.location_id-6000000)
                when corporation_assets.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=corporation_assets.location_id)
                when corporation_assets.location_id BETWEEN 60000000 AND 61000000 then
                    (SELECT s.stationName FROM staStations AS s
                      WHERE s.stationID=corporation_assets.location_id)
                when corporation_assets.location_id BETWEEN 61000000 AND 61001146 then
                    (SELECT d.name FROM `sovereignty_structures` AS c
                      JOIN universe_stations d ON c.structure_id = d.station_id
                      WHERE c.structure_id=corporation_assets.location_id)
                when corporation_assets.location_id > 61001146 then
                    (SELECT name FROM `universe_structures` AS c
                     WHERE c.structure_id = corporation_assets.location_id)
                else (SELECT m.itemName FROM mapDenormalize AS m
                    WHERE m.itemID=corporation_assets.location_id) end
                AS location_name'))
            ->whereIn('location_flag', [
                // These locations look like they are top-level. Even though 'OfficeFolder' is
                // top level, lets just flatten it anyways.
                'AssetSafety', 'OfficeFolder', 'Impounded', 'CorpDeliveries',
            ])
            ->where('corporation_assets.corporation_id', $corporation_id)
            ->get();

    }
516545
public function getOrganizations()
    {
        $sql = "SELECT gor_id_organization, gor_name
                    FROM gems__organizations
                    WHERE gor_active = 1
                    ORDER BY gor_name";

        try {
            $organizations = $this->_getSelectPairsCached(__FUNCTION__, $sql, null, 'organizations', 'natsort');
        } catch (\Exception $exc) {
            // Intentional fallthrough when no db present
            $organizations = array();
        }

        return $organizations;
    }
250178
def list_assets(self):
        
        response = self.requests_session.get(self._base_url).content
        if not response:
            return {}

        try:
            asset_list = json.loads(response)
        except TypeError:
            asset_list = None
        except ValueError:
            raise ValueError(response.decode('UTF-8'))

        if not asset_list:
            return []

        if 'ids' in asset_list:
            return asset_list['ids']
        return []
437986
public function getCharacterContractsItems(int $character_id, int $contract_id): Collection
    {

        return ContractItem::join('invTypes',
            'contract_items.type_id', '=',
            'invTypes.typeID')
            ->join('invGroups',
                'invTypes.groupID', '=',
                'invGroups.groupID')
            ->join('character_contracts', 'character_contracts.contract_id', '=', 'contract_items.contract_id')
            ->where('character_id', $character_id)
            ->where('character_contracts.contract_id', $contract_id)
            ->get();

    }
25933
public static function getAllGroupCompanies($ccgr_id) {
        $sql = "
              SELECT 
                ccmp_id,
                ccmp_name 
              FROM
                ccxg_company_x_group 
                INNER JOIN ccmp_company 
                  ON ccxg_ccmp_id = ccmp_id 
              WHERE ccxg_ccgr_id = :ccgr_id
              ORDER BY ccmp_name
            ";
        return Yii::app()->db
                        ->createCommand($sql)
                        ->bindParam(":ccgr_id", $ccgr_id, PDO::PARAM_INT)
                        ->queryAll();
    }
155895
public function getContractsItemsData(int $corporation_id, int $contract_id)
    {

        $assets = $this->getCorporationContractsItems($corporation_id, $contract_id);

        return view('web::corporation.contractitems', compact('assets'));
    }
1305999
protected function getAssets() {
        if (!$this->_assets) {
            $this->_assets = new AssetList($this->version, $this->solution['sid']);
        }

        return $this->_assets;
    }
1213587
public function listOrganizationsAction($id, Request $request)
    {
        $resource = $this->resourceRepo->findOneBy(['uuid' => $id]);
        $organizations = !empty($resource) ? $resource->getOrganizations() : [];
        $organizationsUuids = array_map(function (Organization $organization) {
            return $organization->getUuid();
        }, $organizations);

        return new JsonResponse(
            $this->finder->search('Claroline\CoreBundle\Entity\Organization\Organization', array_merge(
                $request->query->all(),
                ['hiddenFilters' => ['whitelist' => $organizationsUuids]]
            ))
        );
    }
1332863
public function getActions($imagestyle_id)
    {
        $styles = $this->getList();

        if (empty($styles[$imagestyle_id]['actions'])) {
            return array();
        }

        $actions = $styles[$imagestyle_id]['actions'];
        gplcart_array_sort($actions);
        return $actions;
    }
660283
public function getTracking(int $corporation_id): View
    {

        $members = CorporationMemberTracking::where('corporation_id', $corporation_id)->get();

        return view('mining-ledger::corporation.views.tracking', compact('members'));
    }
1336491
public function getChildren($parent_id = null)
    {
        $parent_id = $parent_id ?? $this->id;
        $children = $this::find()
            ->where(['parent_id' => $parent_id, 'show' => true])
            ->orderBy(['position' => SORT_ASC])
            ->all();
        return $children;
    }
999689
public function getCorporationAssetContents(int $corporation_id,
                                                int $parent_item_id = null): Collection
    {

        $contents = CorporationAsset::with('type')
            ->where('corporation_id', $corporation_id);

        if (! is_null($parent_item_id))
            $contents = $contents->where('location_id', $parent_item_id);

        return $contents->get();
    }
1034003
public function getDepartmentList($id = null)
    {
        $result = $this->httpGet(self::WECHAT_DEPARTMENT_DELETE_PREFIX, [
            'access_token' => $this->getAccessToken(),
        ] + ($id === null ? [] : [
            'id' => $id
        ]));
        return isset($result['errmsg']) && $result['errmsg'] == 'ok' ? $result['department'] : false;
    }
1278173
public function mfaList($employee_id)
    {
        $result = $this->mfaListInternal([
            'employee_id' => $employee_id,
        ]);
        $statusCode = (int)$result[ 'statusCode' ];

        if ($statusCode === 200) {
            return $this->getResultAsArrayWithoutStatusCode($result);
        }

        $this->reportUnexpectedResponse($result, 1506710703);
    }
1046172
public function getLedger(int $corporation_id, int $year = null, int $month = null): View
    {

        if (is_null($year))
            $year = date('Y');

        if (is_null($month))
            $month = date('m');

        $ledgers = $this->getCorporationLedgers($corporation_id);

        $entries = $this->getCorporationLedger($corporation_id, $year, $month);

        return view('web::corporation.mining.ledger', compact('ledgers', 'entries'));
    }
984223
public function getCorporationLedgers(int $corporation_id, bool $get = true)
    {

        $ledger = CharacterMining::select('year', 'month')
            ->join('corporation_member_trackings', 'corporation_member_trackings.character_id', 'character_minings.character_id')
            ->distinct()
            ->where('corporation_id', $corporation_id)
            ->orderBy('year', 'desc')
            ->orderBy('month', 'desc');

        if (! $get)
            return $ledger;

        return $ledger->get();
    }
1250215
public function getItems($product_id)
    {
        $product_ids = array();
        foreach ($this->getList(array('product_id' => $product_id)) as $item) {
            $product_ids[] = $item['item_product_id'];
        }

        return $product_ids;
    }