Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added convenience function getQuery

  • Loading branch information...
commit 45cd92926948414f82196ea4e273a5c33d4e351c 1 parent 5c0054e
= authored
Showing with 26 additions and 0 deletions.
  1. +26 −0 RedBean/SQLHelper.php
View
26 RedBean/SQLHelper.php
@@ -127,5 +127,31 @@ public function clear() {
$this->params = array();
return $this;
}
+
+ /**
+ * To explicitly add a piece of SQL.
+ *
+ * @param string $sql sql
+ *
+ * @return RedBean_SQLHelper
+ */
+ public function addSQL($sql) {
+ if ($this->capture) {
+ $this->sql .= ' '.$sql . ' ';
+ return $this;
+ }
+ }
+
+
+ /**
+ * Returns query parts.
+ *
+ * @return array $queryParts query parts.
+ */
+ public function getQuery() {
+ $list = array($this->sql,$this->params);
+ $this->clear();
+ return $list;
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.