diff options
Diffstat (limited to 'lib/private/debug/query.php')
-rw-r--r-- | lib/private/debug/query.php | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/lib/private/debug/query.php b/lib/private/debug/query.php new file mode 100644 index 00000000000..351c7d9daca --- /dev/null +++ b/lib/private/debug/query.php @@ -0,0 +1,57 @@ +<?php +/** + * Copyright (c) 2014 Robin Appelman <icewind@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OC\Debug; + +use OCP\Debug\IQuery; + +class Query implements IQuery { + private $sql; + + private $params; + + private $start; + + private $end; + + /** + * @param string $sql + * @param array $params + * @param int $start + */ + public function __construct($sql, $params, $start) { + $this->sql = $sql; + $this->params = $params; + $this->start = $start; + } + + public function end($time) { + $this->end = $time; + } + + /** + * @return array + */ + public function getParams() { + return $this->params; + } + + /** + * @return string + */ + public function getSql() { + return $this->sql; + } + + /** + * @return int + */ + public function getDuration() { + return $this->end - $this->start; + } +} |