Returns number of products belonging to the given category.

\public
\static
769706
static function fetchProductCountByCategory( $categoryID )
    {
        $ini = eZINI::instance( 'shop.ini' );
        if ( !$ini->hasVariable( 'VATSettings', 'ProductCategoryAttribute' ) ||
             !$categoryAttrName = $ini->variable( 'VATSettings', 'ProductCategoryAttribute' ) )
            return 0;

        $db = eZDB::instance();
        $categoryID =(int) $categoryID;
        $categoryAttrName = $db->escapeString( $categoryAttrName );
        $query = "SELECT COUNT(*) AS count " .
                 " FROM ezcontentobject_attribute coa, ezcontentclass_attribute cca, ezcontentobject co " .
                 "WHERE " .
                 " cca.id=coa.contentclassattribute_id " .
                 " AND coa.contentobject_id=co.id " .
                 " AND cca.data_type_string='ezproductcategory' " .
                 " AND cca.identifier='$categoryAttrName' " .
                 " AND coa.version=co.current_version " .
                 " AND coa.data_int=$categoryID";
        $rows = $db->arrayQuery( $query );
        return $rows[0]['count'];
    }
982825
public function count(): int
    {
        $size = 0;
        if (!$store = $this->getMessagesStore()) {
            return $size;
        }
        foreach ($store as $messages) {
            $size += \count($messages);
        }
        return $size;
    }
799476
public function getItemCount()
    {
        if (null === $this->itemCount) {
            $this->itemCount = (int) $this->paginator->count();
        }

        return $this->itemCount;
    }
609633
public function length(): int {
        $array = \array_filter($this->heap, function ($v, $k) {
            return $v !== null;
        }, \ARRAY_FILTER_USE_BOTH);
        return \count($array) - 1;
    }
156386
public function count()
    {
        return $this->list->count() +
            count($this->firstItems) +
            count($this->lastItems);
    }
1188726
public function count()
    {
        $traversable = $this->optimizeUnwrap();

        if (is_array($traversable)) {
            return count($traversable);
        }

        return iterator_count($traversable);
    }
1241631
public function getDiscount() : ?int 
    {
        if ( ! $this->hasDiscount()) {
            $this->setDiscount($this->getDefaultDiscount());
        }
        return $this->discount;
    }
254242
public function dontShowEmptyCategories()
    {
        if ($this->_blDontShowEmptyCats == null) {
            $this->_blDontShowEmptyCats = false;
            if ($dontShowEmptyCats = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blDontShowEmptyCategories')) {
                $this->_blDontShowEmptyCats = $dontShowEmptyCats;
            }
        }

        return $this->_blDontShowEmptyCats;
    }
440690
public function count() {
		if(!$this->initialized)
			$this->initialize();

		return count($this->elements) - count($this->toRemove) + count($this->toAdd);
	}
848797
function resolveCategory(categoryParam: number | string, defaultCategory: number): number {
  if (typeof categoryParam === 'number') {
    return categoryParam;
  }

  if (typeof categoryParam === 'string') {
    if (categoryParam in primaryCategoryNumbers) {
      return primaryCategoryNumbers[categoryParam];
    }
  }

  return defaultCategory;
}
1044117
def category(self, category=None):
        
        if category is None:
            return int(self.url.category)
        self.url.category = str(category)
1079658
protected function forCategories() : array
	{
		$categories = $this->products->pluck('category');

		return $categories->mapWithKeys(function ($item) use ($categories) {

				$result[$item->id] = [
					'id' => $item->id,
					'name' => $item->name,
					'qty' => $categories->where('id', $item->id)->count()
				];

				return $result;
		})->all();
	}
628718
function productCategoriesNames()
    {
        $catNames = array();
        $categories = $this->attribute( 'product_categories' );

        if ( $categories )
        {
            foreach ( $categories as $cat )
                $catNames[] = $cat['name'];
        }

        return $catNames;
    }
397281
public function getDepthAttribute()
    {
        $category = $this;

        return $this->remember('depth', function () use ($category) {
            $depth = 0;

            while ($category->parent) {
                $depth++;
                $category = $category->parent;
            }

            return $depth;
        });
    }
455002
public function kb_itemCount($id)
    {
        // I know eloquent does this, but having trouble so hand crafting using DB
        $record =  DB::table('kb_items')->where('kb_category_id', '=', $id)->get();
        return count($record);
    }
1307161
public static function countAll()
    {
        $count = 0;

        $dir = new \DirectoryIterator(static::config('directory'));

        foreach ($dir as $fileinfo) {
            if ($fileinfo->isFile()) {
                $count++;
            }
        }

        return $count;
    }
886992
public function getSumChildCount(): int
    {
        $count = count($this->children);

        foreach ($this->children as $node) {
            $count += $node->getChildCount();
        }

        return $count;
    }