summaryrefslogtreecommitdiffstats
path: root/lib/private/diagnostics/query.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-10-03 20:39:09 +0200
committerRobin Appelman <icewind@owncloud.com>2014-10-20 13:38:38 +0200
commit6e08014781ea0099d7e4466dd48d80af63d8ab69 (patch)
tree393c2848c85c56faf108fb4add77ad26a3156f78 /lib/private/diagnostics/query.php
parent2790bda4f8d6452e65e28935cee62e1ab5468acf (diff)
downloadnextcloud-server-6e08014781ea0099d7e4466dd48d80af63d8ab69.tar.gz
nextcloud-server-6e08014781ea0099d7e4466dd48d80af63d8ab69.zip
Rename namespace to Diagnostics
Diffstat (limited to 'lib/private/diagnostics/query.php')
-rw-r--r--lib/private/diagnostics/query.php57
1 files changed, 57 insertions, 0 deletions
diff --git a/lib/private/diagnostics/query.php b/lib/private/diagnostics/query.php
new file mode 100644
index 00000000000..d50d7592636
--- /dev/null
+++ b/lib/private/diagnostics/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\Diagnostics;
+
+use OCP\Diagnostics\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;
+ }
+}