public function flush() { foreach ($this->pages as $page) { $page->flush(); } $this->pages = array(); $this->currentPage = null; parent::flush(); }