本文整理汇总了PHP中Doctrine_Event::getElapsedSecs方法的典型用法代码示例。如果您正苦于以下问题:PHP Doctrine_Event::getElapsedSecs方法的具体用法?PHP Doctrine_Event::getElapsedSecs怎么用?PHP Doctrine_Event::getElapsedSecs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Doctrine_Event
的用法示例。
在下文中一共展示了Doctrine_Event::getElapsedSecs方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postStmtExecute
/**
* Executed following a Doctrine statement exec query.
*
* @param Doctrine_Event $event The Doctrine event instance.
*
* @return void
*/
public function postStmtExecute(Doctrine_Event $event)
{
$event->end();
$zevent = new Zikula_Event('log.sql', null, array('time' => $event->getElapsedSecs(), 'query' => $event->getQuery()));
EventUtil::notify($zevent);
}
示例2: postStmtExecute
/**
* Logs to the timer.
*
* @param Doctrine_Event $event
*/
public function postStmtExecute(Doctrine_Event $event)
{
sfTimerManager::getTimer('Database (Doctrine)')->addTime();
$args = func_get_args();
$this->__call(__FUNCTION__, $args);
if ($event->getElapsedSecs() > $this->options['slow_query_threshold']) {
$event->slowQuery = true;
}
}
示例3: postStmtExecute
/**
* Executed following a Doctrine statement exec query.
*
* @param Doctrine_Event $event The Doctrine event instance.
*
* @return void
*/
public function postStmtExecute(Doctrine_Event $event)
{
$event->end();
$zevent = new GenericEvent(null, array('time' => $event->getElapsedSecs(), 'query' => $event->getQuery()));
EventUtil::dispatch('log.sql', $zevent);
}
示例4: recordEvent
/**
* Insert a record in the queries table
*
* @param Doctrine_Event $event the event to log
*
* @throws Zend_Db_Profiler_Exception
*
* @return void
*/
public function recordEvent($event)
{
$this->message->setDestroy(false);
// update time counter
$this->totalElapsedTime += $event->getElapsedSecs();
// add a row to the table
$this->message->addRow(array((string) round($event->getElapsedSecs(), 5), $event->getQuery() ? $event->getQuery() : $event->getName(), ($params = $event->getParams()) ? $params : null));
// increment number of queries
$this->totalNumQueries++;
}