function getTotal() {
		if ($this->total === null) {
			$q = clone $this->query;
			$q->setLimit(null);
			$q->setOffset(null);
			if ($this->className) {
				$total = call_user_func(array($this->className, 'doCount'), $q);
			} else {
				$total = $q->doCount();
			}
			$this->total = $total;
		}
		return $this->total;
	}