protected function ensureCursor() { if ($this->cursor === null) { $this->doQuery(); } return $this->cursor; }