public function getIndex() { if ($this->isEmpty()) { return 0; } return 1 + $this->firstResult + $this->defaultIterator()->key(); }