/** * Executes a prepared statement. * * @param array $params OPTIONAL Values to bind to parameter placeholders. * @return bool */ public function execute(array $params = null) { /* * Simple case - no query profiler to manage. */ if ($this->_queryId === null) { return $this->_execute($params); } /* * Do the same thing, but with query profiler * management before and after the execute. */ $prof = $this->_adapter->getProfiler(); $qp = $prof->getQueryProfile($this->_queryId); if ($qp->hasEnded()) { $this->_queryId = $prof->queryClone($qp); $qp = $prof->getQueryProfile($this->_queryId); } if ($params !== null) { $qp->bindParams($params); } else { $qp->bindParams($this->_bindParam); } $qp->start($this->_queryId); $retval = $this->_execute($params); $prof->queryEnd($this->_queryId); return $retval; }