Return's the category with the passed ID.

@param integer $categoryId The ID of the category to return

@return array The category data
@throws \Exception Is thrown, if the category is not available
@deprecated Since 7.0.0
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));
    }
551869
protected function is_category_fully_loaded($categoryid) {
        return (array_key_exists($categoryid, $this->addedcategories) && ($this->allcategoriesloaded || $this->addedcategories[$categoryid]->children->count() > 0));
    }
346836
protected function getCategory($categoryId, $storeViewCode = StoreViewCodes::ADMIN)
    {
        return $this->getSubject()->getCategory($categoryId, $storeViewCode);
    }
482071
public function getChildrenCount($categoryId)
    {
        $select = $this->getConnection()->select()->from(
            $this->getEntityTable(),
            'children_count'
        )->where(
            'entity_id = :entity_id'
        );
        $bind = ['entity_id' => $categoryId];

        return $this->getConnection()->fetchOne($select, $bind);
    }
2443
public function category()
    {
        $category   = $this->param('category_id', 0);
        $categoryId = explode(':', $category)[0];

        return Category::query()->findOrNew($categoryId);
    }
483393
public static function getByCategory($catId, $limit = false, $offset = false, $moreQuerySettings = [])
    {
        return self::getBy(Ajax::CATEGORY, $catId, $limit, $offset, $moreQuerySettings);
    }
257263
private function get_category( $post_id ) {
		$category_data = get_the_category( $post_id );
		$category_arr  = [];
		foreach ( $category_data as $cat ) {
			array_push( $category_arr, $cat->term_id );
		}

		return $category_arr;
	}
60507
private function id($category)
    {
        if (is_null($this->ids)) {
            $this->ids = array();
            $categories = $this->db->all('SELECT category, id FROM categories', '', 'assoc');
            foreach ($categories as $row) {
                $this->ids[$row['category']] = $row['id'];
            }
        }
        if (!isset($this->ids[$category])) {
            $parent = 0;
            $previous = '';
            foreach (explode('/', $category) as $path) {
                if (!isset($this->ids[$previous.$path])) {
                    $this->ids[$previous.$path] = $this->exec('INSERT', 'categories', array($previous.$path, $parent));
                }
                $parent = $this->ids[$previous.$path];
                $previous .= $path.'/';
            }
        }

        return $this->ids[$category];
    }
536509
public GetCategoryRequest.Builder getCategory(String category_id) {
    return new GetCategoryRequest.Builder(accessToken)
            .setDefaults(httpManager, scheme, host, port)
            .category_id(category_id);
  }
1014224
public function getChildren($parentID)
    {
        $tmp = [];
        foreach($this->categoryList as $key => $item){
            if($item->parentID == $parentID) {
                $tmp[] = $item;
            }
        }

        return $tmp;
    }
810617
protected function load_category($categoryid) {
        global $DB;
        $category = $DB->get_record('course_categories', array('id' => $categoryid));
        if (!$category) {
            throw new moodle_exception('unknowncategory');
        }
        $this->_categories[$category->id] = $category;
        $parentcategoryids = explode('/', trim($category->path, '/'));
        array_pop($parentcategoryids);
        foreach (array_reverse($parentcategoryids) as $catid) {
            $this->_categories[$catid] = null;
        }
    }
1031555
protected function getCategory($id)
    {
        $category = $this->categoryManager->find($id);

        if (null === $category) {
            throw new NotFoundHttpException(sprintf('Category (%d) not found', $id));
        }

        return $category;
    }
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;
    }
95260
public function setCategoryId($categoryId = '')
    {
        $this->categoryId = $categoryId;
        $this->logger->info(__FUNCTION__, 'setCategoryId: ' . $this->categoryId);
    }
504663
public function getCategory(int $categoryId, int $siteId) : array
    {
        Assert::that($categoryId)->greaterThan(0, 'The $categoryId has to be positive');
        Assert::that($siteId)->greaterThan(0, 'The $siteId has to be positive');

        return (array)$this->master->doRequest(
            'GET',
            sprintf('/admin/WEBAPI/Endpoints/v1_0/ProductService/{KEY}/Category/%d/%d', $categoryId, $siteId)
        );
    }
237410
def category(self):
        
        if self.api and self.category_id:
            return self.api._get_category(self.category_id)
478665
public function seedCategory($category_id = 0)
    {
        $categories = $this->blender->getCategoryMap();
        if (isset($categories['ids'][$category_id]) && isset($categories['ids'][$category_id]['lineage'])) {
            return $categories['ids'][$category_id]['lineage'];
        }

        return '';
    }