// 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.
*/