/** * Fetch * * @return bool|mixed */ public function fetch() { if (!$this->stmtActive) { return false; } $args = new ArrayObject(); try { $eventRs = $this->triggerPre(__FUNCTION__, $args); if ($eventRs->stopped()) { return $eventRs->last(); } if ($this->stmtGlob !== null) { $result = $this->fetchByGlob(); if ($result === false) { // clear statement $this->stmtActive = false; $this->stmtGlob = null; $this->stmtMatch = null; $this->stmtOptions = null; } } else { $result = parent::fetch(); } return $this->triggerPost(__FUNCTION__, $args, $result); } catch (Exception $e) { return $this->triggerException(__FUNCTION__, $args, $e); } }