Returns active category

@return null|oxCategory
501513
public function getActiveCategory()
    {
        $oCategory = \OxidEsales\Eshop\Core\Registry::getConfig()->getTopActiveView()->getActiveCategory();
        if ($oCategory) {
            $this->setActiveCategory($oCategory);
        }

        return $this->_oActCategory;
    }
1274535
public function getActCategory()
    {
        $oCat = oxNew(\OxidEsales\Eshop\Application\Model\Category::class);

        return ($oCat->load($this->getActCatId())) ? $oCat : null;
    }
1288395
public function getActCategory()
    {
        // if active category is not set yet - trying to load it from request params
        // this may be usefull when category component was unable to load active category
        // and we still need some object to mount navigation info
        if ($this->_oClickCat === null) {
            $this->_oClickCat = false;
            $oCategory = oxNew(\OxidEsales\Eshop\Application\Model\Category::class);
            if ($oCategory->load($this->getCategoryId())) {
                $this->_oClickCat = $oCategory;
            }
        }

        return $this->_oClickCat;
    }
331821
public function getActiveTo()
    {
        return ! empty($value = $this->getContentValue('active_to', null))
            ? $this->convertToCarbon($value)
            : null;
    }
362501
public function hasSkipDiscountCategories()
    {
        if ($this->_hasSkipDiscountCategories === null || $this->_blReload) {
            $sViewName = getViewName('oxcategories');
            $sQ = "select 1 from {$sViewName} where {$sViewName}.oxactive = 1 and {$sViewName}.oxskipdiscounts = '1' ";

            $this->_hasSkipDiscountCategories = (bool) \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->getOne($sQ);
        }

        return $this->_hasSkipDiscountCategories;
    }
221649
public function getCategory($key)
    {
        return array_key_exists($key, $this->_categories) ? $this->_categories[$key] : null;
    }
1013451
protected function getActiveMenuRoute()
    {
        if (is_null($this->activeMenuRoute)) {
            $this->activeMenuRoute = Registry::get('active_menu_route');
        }
        return $this->activeMenuRoute;
    }
793774
public function getDefaultSorting()
    {
        $sorting = parent::getDefaultSorting();
        $activeCategory = $this->getActiveCategory();

        if ($this->getListType() != 'search' && $activeCategory && $activeCategory instanceof \OxidEsales\Eshop\Application\Model\Category) {
            if ($categorySorting = $activeCategory->getDefaultSorting()) {
                $sortingDirection = ($activeCategory->getDefaultSortingMode()) ? "desc" : "asc";
                $sorting = ['sortby' => $categorySorting, 'sortdir' => $sortingDirection];
            }
        }

        return $sorting;
    }
1056226
protected function magic_get_category() {
        $this->ensure_category_loaded();
        if (!empty($this->_categories)) {
            return reset($this->_categories);
        } else {
            return null;
        }
    }
839473
public function getParentCategory()
    {
        $oCat = null;

        // loading only if parent id is not rootid
        if ($this->oxcategories__oxparentid->value && $this->oxcategories__oxparentid->value != 'oxrootid') {
            // checking if object itself has ref to parent
            if ($this->_oParent) {
                $oCat = $this->_oParent;
            } else {
                $oCat = oxNew(\OxidEsales\Eshop\Application\Model\Category::class);
                if (!$oCat->load($this->oxcategories__oxparentid->value)) {
                    $oCat = null;
                } else {
                    $this->_oParent = $oCat;
                }
            }
        }

        return $oCat;
    }
634075
public function getActiveShop()
    {
        if ($this->_oActShop && $this->_iShopId == $this->_oActShop->getId() &&
            $this->_oActShop->getLanguage() == Registry::getLang()->getBaseLanguage()
        ) {
            return $this->_oActShop;
        }

        $this->_oActShop = oxNew(\OxidEsales\Eshop\Application\Model\Shop::class);
        $this->_oActShop->load($this->getShopId());

        return $this->_oActShop;
    }
1244597
protected function get_current_category($categoryandcontext) {
        global $DB, $OUTPUT;
        list($categoryid, $contextid) = explode(',', $categoryandcontext);
        if (!$categoryid) {
            $this->print_choose_category_message($categoryandcontext);
            return false;
        }

        if (!$category = $DB->get_record('question_categories',
                array('id' => $categoryid, 'contextid' => $contextid))) {
            echo $OUTPUT->box_start('generalbox questionbank');
            echo $OUTPUT->notification('Category not found!');
            echo $OUTPUT->box_end();
            return false;
        }

        return $category;
    }
1304190
public function getCategory()
    {
        if ($this->_oCategory === null) {
            $this->_oCategory = $this->getProduct()->getCategory();
        }

        return $this->_oCategory;
    }
1062735
public function get_parent_category() {
        if ($this->is_category_item() or $this->is_course_item()) {
            return $this->get_item_category();

        } else {
            return grade_category::fetch(array('id'=>$this->categoryid));
        }
    }
809873
public function getDefaultSorting()
    {
        $sorting = parent::getDefaultSorting();

        $category = $this->getActiveCategory();
        if ($category && $category instanceof \OxidEsales\Eshop\Application\Model\Category) {
            if ($defaultSorting = $category->getDefaultSorting()) {
                $articleViewName = getViewName('oxarticles');
                $sortBy = $articleViewName . '.' . $defaultSorting;
                $sortDirection = ($category->getDefaultSortingMode()) ? "desc" : "asc";
                $sorting = ['sortby' => $sortBy, 'sortdir' => $sortDirection];
            }
        }

        return $sorting;
    }
465107
public function load_item_category() {
        if (empty($this->item_category->id)) {
            $this->item_category = $this->get_item_category();
        }
        return $this->item_category;
    }
540270
public function getCategory()
    {
        $categoryModel = static::getCategoryModel();
        return ($this->type == self::TYPE_CATEGORY) ? $this->hasOne($categoryModel::className(), ['id' => $this->options->category_id]) : null;
    }