Spot\Log::addQuery PHP Метод

addQuery() публичный статический Метод

Add query to log
public static addQuery ( $adapter, mixed $query, mixed $data = null )
$query mixed Query run
$data mixed Data used in query - usually array, but can be scalar or null
    public static function addQuery($adapter, $query, $data = null)
    {
        // Shift element off beginning of array if we're at the query limit
        if (self::queryCount() >= self::queryLimit()) {
            array_shift(self::$_queries);
        }
        self::$_queries[] = array('adapter' => get_class($adapter), 'query' => $query, 'data' => $data);
        self::$_queryCount++;
    }

Usage Example

Пример #1
0
 /**
  * Drop a database table
  * Destructive and dangerous - drops entire table and all data
  * Will throw errors if user does not have proper permissions
  */
 public function dropDatabase($database)
 {
     $sql = "DROP DATABASE " . $database;
     // Add query to log
     \Spot\Log::addQuery($this, $sql);
     return $this->connection()->exec($sql);
 }
All Usage Examples Of Spot\Log::addQuery