This is the API docs for LemonStand V1, which has been discontinued. LemonStand is now a cloud based platform, available at lemonstand.com.

LemonStand API

core:onAfterDatabaseQuery event

Triggered by /phproad/modules/db/classes/db_sqlbase.php
Author LemonStand eCommerce Inc.

Event handler signature

public void event_onAfterDatabaseQuery(string $query, mixed $result)
$query string specifies the SQL query string.
$result mixed specifies the query result value.
Triggered before a SQL query is executed by the database. This event is triggered only if the ENABLE_DEVELOPER_TOOLS configuration option is enabled. The handler should accept two parameters - the SQL query string and MySQL query result value. The result value depends on the query type and described in PHP documentation. Event handler example:
public function subscribeEvents()
{
  Backend::$events->addEvent('core:onBeforeDatabaseQuery', $this, 'on_before_query');
  Backend::$events->addEvent('core:onAfterDatabaseQuery', $this, 'on_after_query');
}

public function on_before_query($sql)
{
  // Start timing for the query
  Phpr_DebugHelper::start_timing($sql);
}

public function on_after_query($sql, $result)
{
  // Stop timing and write the result to the trace log (logs/info.txt)
  Phpr_DebugHelper::end_timing($sql);
}