hasEnded example


        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);

        
// Check for a valid query handle.         if (!isset($this->_queryProfiles[$queryId])) {
            /** * @see Zend_Db_Profiler_Exception */
            throw new Zend_Db_Profiler_Exception("Profiler has no query with handle '$queryId'.");
        }

        $qp = $this->_queryProfiles[$queryId];

        // Ensure that the query profile has not already ended         if ($qp->hasEnded()) {
            /** * @see Zend_Db_Profiler_Exception */
            throw new Zend_Db_Profiler_Exception("Query with profiler handle '$queryId' has already ended.");
        }

        // End the query profile so that the elapsed time can be calculated.         $qp->end();

        /** * If filtering by elapsed time is enabled, only keep the profile if * it ran for the minimum time. */
Home | Imprint | This part of the site doesn't use cookies.