Return's the category with the passed ID.

@param integer $categoryId    The ID of the category to return
@param string  $storeViewCode The store view code of category to return

@return array The category data
346836
protected function getCategory($categoryId, $storeViewCode = StoreViewCodes::ADMIN)
    {
        return $this->getSubject()->getCategory($categoryId, $storeViewCode);
    }
588914
private function getStoreData($productId, $storeId, $attributeCode)
    {
        if (array_key_exists($productId, $this->attributeData)
            && array_key_exists($storeId, $this->attributeData[$productId])
            && array_key_exists($attributeCode, $this->attributeData[$productId][$storeId])
        ) {
            return $this->attributeData[$productId][$storeId][$attributeCode];
        }

        return null;
    }
1138831
public function loadCategoryData($storeId, $productIds)
    {
        $select       = $this->getCategoryProductSelect($productIds, $storeId);
        $categoryData = $this->getConnection()->fetchAll($select);

        $categoryIds = [];

        foreach ($categoryData as $categoryDataRow) {
            $categoryIds[] = $categoryDataRow['category_id'];
        }

        $storeCategoryName = $this->loadCategoryNames(array_unique($categoryIds), $storeId);

        foreach ($categoryData as &$categoryDataRow) {
            $categoryDataRow['name'] = '';
            if (isset($storeCategoryName[(int) $categoryDataRow['category_id']])) {
                $categoryDataRow['name'] = $storeCategoryName[(int) $categoryDataRow['category_id']];
            }
        }

        return $categoryData;
    }
967475
public function search($categoryId = null, $onlyVisible = false)
    {
        $query = static::find();
        if ($categoryId) {
            $query->andWhere(['category_id' => $categoryId]);
        }
        if ($onlyVisible) {
            $query->joinWith(['category' => function ($query) {
                $query->andWhere([Category::tableName() . '.visible' => 1]);
            }]);
            $query->andWhere([static::tableName() . '.visible' => 1]);
        }

        $dataProvider = new ActiveDataProvider(['query' => $query]);
        $dataProvider->sort->defaultOrder = ['sort' => SORT_ASC, 'id' => SORT_ASC];
        return $dataProvider;
    }
874501
protected function setCategory($category_id)
    {
        $options = array(
            'category_id' => $category_id,
            'language' => $this->langcode,
            'store_id' => $this->store_id
        );

        $this->data_category = $this->category->get($options);

        if (empty($this->data_category['status'])) {
            $this->outputHttpStatus(404);
        }

        $this->prepareCategory($this->data_category);
    }
37429
public Category getCategory(int pageId) {
        long hibernateId = __getCategoryHibernateId(pageId);
        if (hibernateId == -1) {
            return null;
        }

        try {
            Category cat = new Category(this, hibernateId);
            return cat;
        } catch (WikiPageNotFoundException e) {
            return null;
        }
    }
578589
public function getActiveCategoryIdList( $categoryId, $parentType ) {

		$modelClass	= static::$modelClass;

		$models = $modelClass::findActiveByCategoryIdParentType( $categoryId, $parentType );
		$ids	= [];

		foreach ( $models as $model ) {

			$category = $model->category;

			$ids[] = $category->id;
		}

		return $ids;
	}
700325
public static function findByNameCategoryId( $name, $categoryId ) {

		$optionTable = CoreTables::getTableName( CoreTables::TABLE_OPTION );

		return self::find()->where( "$optionTable.name=:name AND $optionTable.categoryId=:id", [ ':name' => $name, ':id' => $categoryId ] )->one();
	}
1034398
private function getAttributeValueAlias($attributeCode, $storeId = null)
    {
        $returnValue = $attributeCode;
        if ($storeId !== null) {
            $returnValue .= '_' . $storeId;
        }
        return $returnValue;
    }
1049984
public function getStoreByStoreCode($storeCode)
    {

        // query whether or not the store with the passed store code exists
        if (isset($this->stores[$storeCode])) {
            return $this->stores[$storeCode];
        }

        // throw an exception, if not
        throw new \Exception(
            $this->appendExceptionSuffix(
                sprintf('Found invalid store code %s', $storeCode)
            )
        );
    }
844533
private function getStoreId(Category $category)
    {
        $storeId = $category->getStoreId();

        if ($storeId === 0) {
            $defaultStoreId   = $this->getDefaultStoreId();
            $categoryStoreIds = array_filter($category->getStoreIds());
            $storeId        = current($categoryStoreIds);
            if (in_array($defaultStoreId, $categoryStoreIds)) {
                $storeId = $defaultStoreId;
            }
        }

        return $storeId;
    }
323093
public function getCategory($categoryId)
    {

        // try to load the category with the passed ID
        foreach ($this->categories as $category) {
            if ($category[MemberNames::ENTITY_ID] == $categoryId) {
                return $category;
            }
        }

        // throw an exception if the category is NOT available
        throw new \Exception(sprintf('Can\'t load category with ID %d in file %s on line %d', $categoryId));
    }
536509
public GetCategoryRequest.Builder getCategory(String category_id) {
    return new GetCategoryRequest.Builder(accessToken)
            .setDefaults(httpManager, scheme, host, port)
            .category_id(category_id);
  }
141706
private function handleCategoryStoreData($category)
    {
        $returnArray = [];

        foreach ($this->storeIds as $storeId => $storeObject) {
            $returnArray[] = $this->categoryStoreDataFactory->create()
                ->setStoreId($storeId)
                ->setIsActive($category->getData($this->getAttributeValueAlias('is_active', $storeId)))
                ->setImage($this->handleImage($category, $storeObject))
                ->setName($category->getData($this->getAttributeValueAlias('name', $storeId)))
                ->setDescription($category->getData($this->getAttributeValueAlias('description', $storeId)));
        }

        return $returnArray;
    }
939811
protected function getCategoryByPath($path, $storeViewCode = StoreViewCodes::ADMIN)
    {
        return $this->getSubject()->getCategoryByPath($path, $storeViewCode);
    }
541577
public function find(int $id): CategoryInterface
    {
        $response = $this->shopware()->get('/api/categories/'.(string)$id);

        $categoryWrapper = $this->deserializer()
                                ->deserialize((string)$response->getBody());

        $category = $categoryWrapper->getData();
        if ( ! $category instanceof CategoryInterface) {
            throw new \LogicException();
        }

        return $category;
    }
1184098
public function deleteByCategoryId(int $categoryId)
    {
        $deleteCondition = [sprintf("%s = ?", $this->getIdFieldName()) => $categoryId];

        return (bool) $this->getConnection()->delete($this->getMainTable(), $deleteCondition);
    }