Sets a total number of products found for the category
@return int
179735
protected function setTotalIndexCategory()
    {
        $options = $this->query_filter;
        $options['count'] = true;
        $options['category_id'] = $this->data_category['category_id'];

        return $this->data_total = (int) $this->product->getList($options);
    }
1025766
protected function getTotalCount()
    {
        $query = $this->modelRepository->query();

        $this->applyListParentToQuery($query);

        return $query->count();
    }
309939
public function totals()
    {
        $totals = Collection::make();

        foreach (Arr::except($this->footer(), 'all') as $level => $count) {
            $totals->put($level, [
                'label'     => $this->translate("levels.$level"),
                'value'     => $count,
                'color'     => $this->color($level),
                'highlight' => $this->color($level),
            ]);
        }

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

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

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

            return $depth;
        });
    }
607640
public function getTotal()
    {
        if (is_null($this->_total)) {
            if (($total = $this->predictTotal())) {
                $this->_total = $total;
            } elseif (isset($this->_items)) {
                return count($this->_items);
            } else {
                $this->_total = false;
            }
        }

        return $this->_total;
    }
1241631
public function getDiscount() : ?int 
    {
        if ( ! $this->hasDiscount()) {
            $this->setDiscount($this->getDefaultDiscount());
        }
        return $this->discount;
    }
1342362
protected function getProductCountAttribute()
    {
        $iProductCount = $this->getAttribute('product_count');
        if ($iProductCount !== null) {
            return $iProductCount;
        }

        //Get product count from cache
        $arCacheTag = [static::class];
        $sCacheKey = 'product_count_'.$this->id;

        $iProductCount = CCache::get($arCacheTag, $sCacheKey);
        if ($iProductCount !== null) {
            return $iProductCount;
        }

        //Calculate product count from child categories
        $iProductCount = 0;
        $obChildCategoryCollect = $this->children;
        if ($obChildCategoryCollect->isNotEmpty()) {
            /** @var CategoryItem $obChildCategoryItem */
            foreach ($obChildCategoryCollect as $obChildCategoryItem) {
                if ($obChildCategoryItem->isEmpty()) {
                    continue;
                }

                $iProductCount += $obChildCategoryItem->product_count;
            }
        }

        $iProductCount += ProductCollection::make()->active()->category($this->id)->count();

        CCache::forever($arCacheTag, $sCacheKey, $iProductCount);
        $this->setAttribute('product_count', $iProductCount);

        return $iProductCount;
    }
806754
public function count()
    {
        $countItems = $this->countItems() - $this->getItemOffset();
        if ($countItems >= $this->getItemCount()) {
            $countItems = $this->getItemCount();
        }
        return $countItems;
    }
448979
protected function calculateTotal()
    {
        $otherConfig = $this->getOtherConfig();
        $total       = $this
            ->getEnvironment()
            ->getDataProvider()
            ->fetchAll($otherConfig->setIdOnly(true));

        if (\is_array($total)) {
            $this->intTotal = $total ? \count($total) : 0;

            return;
        }

        if (\is_object($total)) {
            $this->intTotal = $total->length();

            return;
        }

        $this->intTotal = 0;
    }
1111903
public function setNumTotalResults( $total )
	{
		$total = (int)$total;
		if ( $total < 0 )
		{
			trigger_error( 'Pagination setNumTotalResults: Total must be positive.' );
			return false;
		}

		$this->items_total = $total;
	}
1088423
public function getTotal()
    {
        $query = $this->getQuery()->select('COUNT(*) as total');

        $rows = $this->database->query($query, $this->database->getBinds());

        if (!isset($rows[0]['total'])) {
            return 0;
        }

        return $rows[0]['total'];
    }
1106617
public function sum(){
		
		Number::setScale(static::NUMERIC_FUNCTIONS_SCALE);
		
		$total = '0';
		
		foreach($this->_Arr as $item){
			$total = Number::add($total, \strval($item));
		}
		
		return $total;
		
	}
517608
public function get_number_of_items() {
        global $DB;

        if (is_null($this->itemsavailable)) {
            $this->itemsavailable = $DB->get_field_sql('
                    SELECT MIN(qdd.itemcount)
                      FROM {question_dataset_definitions} qdd
                      JOIN {question_datasets} qd ON qdd.id = qd.datasetdefinition
                     WHERE qd.question = ?
                    ', array($this->questionid), MUST_EXIST);
        }

        return $this->itemsavailable;
    }
1321898
public function calculateTotal()
    {
        $this->total = $this->getItemsTotal() + $this->getAdjustmentTotal();

        if ($this->total < 0) {
            $this->total = 0;
        }

        return $this;
    }
1057501
public function getBasketTotal()
    {
        $total = $this->find()
            ->where([
                'id_user' => $this->idUser,
                'storage' => $this->owner->storageName
            ])
            ->sum('count');

        return ($total) ? $total : 0;
    }
799476
public function getItemCount()
    {
        if (null === $this->itemCount) {
            $this->itemCount = (int) $this->paginator->count();
        }

        return $this->itemCount;
    }
1021302
public function getItemsCount()
    {
        $count = 0;
        foreach ($this->feeds_registry as $feed) {
            $count += $feed->getItemsCount();
        }
        return $count;
    }