Resets category (all categories) article count

@param string $sCatId Category/vendor/manufacturer ID
973938
public function resetCatArticleCount($sCatId = null)
    {
        if (!$sCatId) {
            \OxidEsales\Eshop\Core\Registry::getConfig()->setGlobalParameter('aLocalCatCache', null);
            \OxidEsales\Eshop\Core\Registry::getUtils()->toFileCache('aLocalCatCache', '');
        } else {
            // loading from cache
            $aCatData = $this->_getCatCache();
            if (isset($aCatData[$sCatId])) {
                unset($aCatData[$sCatId]);
                $this->_setCatCache($aCatData);
            }
        }
    }
1242926
public function resetStats(array $entities)
     {
         foreach ($entities as $entity) {
            $ids = $entity->subscriptions
                          ->getQuery()
                          ->disableChain()
                          ->fetchValues('subscriber.id');

            $entity->set('subscriberCount', count($ids));
            $entity->set('subscriberIds', AnDomainAttribute::getInstance('set')->setData($ids));
            $entity->save();
        }
    }
283212
public function resetMarketplaceIds(){
        foreach($this->options as $op=>$junk){
            if(preg_match("#MarketplaceIdList#",$op)){
                unset($this->options[$op]);
            }
        }
    }
410690
protected function clearCategoryProductCount($iCategoryID)
    {
        $obCategoryItem = CategoryItem::make($iCategoryID);
        if ($obCategoryItem->isNotEmpty()) {
            $obCategoryItem->clearProductCount();
        }
    }
1272865
function(sCategory) {
        var filtersArray = this._categoryFilters;
        for(var i=0; i<filtersArray.length; i++) {
            if(sCategory == filtersArray[i]) {
                filtersArray.splice(i, 1);
                break;
            }
        }
        this._filterLogs();
        var elCheckbox = this.getCheckbox(sCategory);
        if(elCheckbox) {
            elCheckbox.checked = false;
        }
    }
891117
def delete_category(self, category):
        """"""
        # Remove mapping of metrics-to-category
        category_key = self._category_key(category)
        self.r.delete(category_key)

        # Remove category from Set
        self.r.srem(self._categories_key, category)
802489
public function ResetAllDiscounts()
    {
        $iCurrentPosition = $this->getItemPointer();
        $this->GoToStart();

        while ($oItem = &$this->Next()) {
            $oItem->ResetDiscounts();
        }
        $this->setItemPointer($iCurrentPosition);
    }
1029529
public function SetCategoryPermissionIDs() {
      // First build a list of category
      $Permissions = $this->SQL->GetWhere('Permission', array('JunctionColumn' => 'PermissionCategoryID', 'JunctionID >' => 0))->ResultArray();
      $CategoryIDs = array();
      foreach ($Permissions as $Row) {
         $CategoryIDs[$Row['JunctionID']] = $Row['JunctionID'];
      }
      
      // Update all of the child categories.
      $Root = CategoryModel::Categories(-1);
      $this->_SetCategoryPermissionIDs($Root, $Root['CategoryID'], $CategoryIDs);
   }
1082973
public function reset($properties = null)
    {
        unset($this->manufacturer);
        unset($this->model);
        unset($this->series);
        unset($this->carrier);
        unset($this->identifier);

        $this->type = '';
        $this->subtype = '';
        $this->identified = Constants\Id::NONE;
        $this->generic = true;
        $this->hidden = false;

        if (is_array($properties)) {
            $this->set($properties);
        }
    }
649960
protected function setDataCategoriesEditCategory()
    {
        $category_id = $this->getData('category.category_id');

        if (isset($category_id)) {

            $category_group_id = $this->getData('category_group.category_group_id');

            $options = array(
                'parent_id' => $category_id,
                'category_group_id' => $category_group_id
            );

            $children = $this->category->getTree($options);

            $exclude = array($category_id);
            foreach ($children as $child) {
                $exclude[] = $child['category_id'];
            }

            $categories = $this->getData('categories');
            $modified = array_diff_key($categories, array_flip($exclude));
            $this->setData('categories', $modified);
        }
    }
524173
public function setCancelCategory($value)
    {
        if (!in_array($value, self::cancelCategories(), true)) {
            throw new DomainException(sprintf(self::UNEXPECTED_CATEGORY, implode(', ', self::cancelCategories())));
        }

        return $this->setAttribute('cancelCategory', $value);
    }
201885
public function reset($newAllCount = null)
    {
        if ($newAllCount !== null) {
            $this->all = $newAllCount;
            $this->allCountLength = strlen("$newAllCount");
        }
        $this->start = microtime(true);
        $this->handled = 0;
    }
696006
public function reset($properties = null)
    {
        parent::reset();

        unset($this->channel);
        unset($this->using);
        unset($this->family);

        $this->stock = true;
        $this->hidden = false;
        $this->mode = '';
        $this->type = '';

        if (is_array($properties)) {
            $this->set($properties);
        }
    }
651754
public function setVendorArticleCount($aCache, $sCatId, $sActIdent)
    {
        // if vendor/category name is 'root', skip counting
        if ($sCatId == 'root') {
            return 0;
        }

        $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
        $sTable = $oArticle->getViewName();

        // select each vendor articles count
        $sQ = "select $sTable.oxvendorid AS vendorId, count(*) from $sTable where ";
        $sQ .= "$sTable.oxvendorid <> '' and $sTable.oxparentid = '' and " . $oArticle->getSqlActiveSnippet() . " group by $sTable.oxvendorid ";
        $aDbResult = $this->getAssoc($sQ);

        foreach ($aDbResult as $sKey => $sValue) {
            $aCache[$sKey][$sActIdent] = $sValue;
        }

        $this->_setVendorCache($aCache);

        return isset($aCache[$sCatId][$sActIdent]) ? $aCache[$sCatId][$sActIdent] : 0;
    }
453473
protected function set_categories() {
		$categories = get_the_category( get_the_ID() );
		if ( $categories ) {
			$category = array_shift( $categories );
			$this->set_ancestors( $category->term_id, 'category' );
			$this->set( $category->name, get_term_link( $category ) );
		}
	}
744945
private function resetState(?string $namespace = null): void
    {
        $this->parts = new SplDoublyLinkedList();
        $this->parts->push($namespace);
    }
786978
public function deleteCategory($data = [])
    {
        $client = $this->getClient();
        $errors = [];

        if ($category = $this->getCategory($data['code'])) {
            $result = $client->delete($category);

            $errors = array_merge($errors, $client->getErrors($result));
            if (count($errors)) {
                Injector::inst()->get(LoggerInterface::class)->error('deleteCategory errors - ' . json_encode($errors));
            }
        }
    }