141ac230aa0077ced9c15eb2fe1eecf49acd9507
[m6w6/pq-gateway] / lib / pq / Query / ExecutorInterface.php
1 <?php
2
3 namespace pq\Query;
4
5 /**
6 * An executor of \pq\Query\Writer queries
7 */
8 interface ExecutorInterface
9 {
10 /**
11 * Get the connection
12 * @return \pq\Connection
13 */
14 function getConnection();
15
16 /**
17 * Set the connection
18 * @param \pq\Connection $conn
19 * @return \pq\Query\ExecutorInterface
20 */
21 function setConnection(\pq\Connection $conn);
22
23 /**
24 * Execute the query and return the \pq\Result through $callback
25 * @param \pq\Query\WriterInterface $query
26 * @param callable $callback
27 * @return mixed the result of the callback
28 */
29 function execute(WriterInterface $query, callable $callback);
30 }