flush
[m6w6/pq-gateway] / lib / pq / Query / WriterInterface.php
index 32e133baaa905c1e85d8f21ded78f653f37308f4..885d4ca8db00a0003ec4f03597cee20e40a8658e 100644 (file)
@@ -2,14 +2,49 @@
 
 namespace pq\Query;
 
+/**
+ * A query writer which supports easily constructing queries for \pq\Connection::execParams()
+ */
 interface WriterInterface
 {
+       /**
+        * Returns the plain constructed query as string
+        * @return string
+        */
        function __toString();
+       
+       /**
+        * Returns a list of parameters as array
+        * @return array
+        */
        function getParams();
+       
+       /**
+        * Returns a list any types associated with the params
+        */
        function getTypes();
+       
+       /**
+        * Reset the state of the query writer
+        */
+       function reset();
+       
+       /**
+        * Write plain SQL to the query
+        * @param mixed $arg variable list of arguments, arrays will be imploded to a comm separated list
+        */
        function write(/*...*/);
+       
+       /**
+        * Remember the parameter with any associated type and return $N to be written to the query string
+        * @param mixed $param a literal parameter, a \pq\Gateway\Table\Cell or a \pq\Query\Expr
+        * @param int $type the oid of the type of the param
+        */
        function param($param, $type = null);
+       
+       /**
+        * An array of AND/OR criteria
+        * @param array $criteria
+        */
        function criteria(array $criteria);
-       function reset();
-       function exec(\pq\Connection $c);
 }