LoggedQuery.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /**
  3. * PHP Version 5.4
  4. *
  5. * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  6. * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  7. *
  8. * Licensed under The MIT License
  9. * For full copyright and license information, please see the LICENSE.txt
  10. * Redistributions of files must retain the above copyright notice.
  11. *
  12. * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  13. * @link http://cakephp.org CakePHP(tm) Project
  14. * @since CakePHP(tm) v 3.0.0
  15. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  16. */
  17. namespace Cake\Database\Log;
  18. /**
  19. * Contains a query string, the params used to executed it, time taken to do it
  20. * and the number of rows found or affected by its execution.
  21. */
  22. class LoggedQuery {
  23. /**
  24. * Query string that was executed
  25. *
  26. * @var string
  27. */
  28. public $query = '';
  29. /**
  30. * Number of milliseconds this query took to complete
  31. *
  32. * @var float
  33. */
  34. public $took = 0;
  35. /**
  36. * Associative array with the params bound to the query string
  37. *
  38. * @var string
  39. */
  40. public $params = [];
  41. /**
  42. * Number of rows affected or returned by the query execution
  43. *
  44. * @var integer
  45. */
  46. public $numRows = 0;
  47. /**
  48. * Returns the string representation of this logged query
  49. *
  50. * @return void
  51. */
  52. public function __toString() {
  53. return $this->query;
  54. }
  55. }