add identity and lock
[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 * @codeCoverageIgnore
8 */
9 interface ExecutorInterface extends \SplSubject
10 {
11 /**
12 * Get the connection
13 * @return \pq\Connection
14 */
15 function getConnection();
16
17 /**
18 * Set the connection
19 * @param \pq\Connection $conn
20 * @return \pq\Query\ExecutorInterface
21 */
22 function setConnection(\pq\Connection $conn);
23
24 /**
25 * Execute the query and return the \pq\Result through $callback
26 * @param \pq\Query\WriterInterface $query
27 * @param callable $callback
28 * @return mixed the result of the callback
29 */
30 function execute(WriterInterface $query, callable $callback);
31
32 /**
33 * @return WriterInterface
34 */
35 function getQuery();
36
37 /**
38 * @return \pq\Result
39 */
40 function getResult();
41
42 }