public function count()
    {
        $countItems = $this->countItems() - $this->getItemOffset();
        if ($countItems >= $this->getItemCount()) {
            $countItems = $this->getItemCount();
        }
        return $countItems;
    }