QueryExecuted.php 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. namespace Illuminate\Database\Events;
  3. class QueryExecuted
  4. {
  5. /**
  6. * The SQL query that was executed.
  7. *
  8. * @var string
  9. */
  10. public $sql;
  11. /**
  12. * The array of query bindings.
  13. *
  14. * @var array
  15. */
  16. public $bindings;
  17. /**
  18. * The number of milliseconds it took to execute the query.
  19. *
  20. * @var float
  21. */
  22. public $time;
  23. /**
  24. * The database connection instance.
  25. *
  26. * @var \Illuminate\Database\Connection
  27. */
  28. public $connection;
  29. /**
  30. * The database connection name.
  31. *
  32. * @var string
  33. */
  34. public $connectionName;
  35. /**
  36. * Create a new event instance.
  37. *
  38. * @param string $sql
  39. * @param array $bindings
  40. * @param float|null $time
  41. * @param \Illuminate\Database\Connection $connection
  42. * @return void
  43. */
  44. public function __construct($sql, $bindings, $time, $connection)
  45. {
  46. $this->sql = $sql;
  47. $this->time = $time;
  48. $this->bindings = $bindings;
  49. $this->connection = $connection;
  50. $this->connectionName = $connection->getName();
  51. }
  52. }