storage enhancements
[m6w6/pq-gateway] / lib / pq / Mapper / StorageInterface.php
1 <?php
2
3 namespace pq\Mapper;
4
5 interface StorageInterface
6 {
7 /**
8 * Find by PK
9 * @param mixed $pk
10 * @return object
11 */
12 function get($pk);
13
14 /**
15 * Find
16 * @param array $where
17 * @param string $order
18 * @param int $limit
19 * @param int $offset
20 * @return object[]
21 */
22 function find($where = [], $order = null, $limit = null, $offset = null);
23
24 /**
25 * Find parent
26 * @param object $object
27 * @param string $refName
28 * @return object
29 */
30 function by($object, $refName);
31
32 /**
33 * Find child rows
34 * @param object $object
35 * @param string $refName
36 * @return array
37 */
38 function of($object, $refName);
39
40 /**
41 * Delete
42 * @param object $object
43 */
44 function delete($object);
45
46 /**
47 * Save
48 * @param object $object
49 */
50 function save($object);
51
52 /**
53 * Buffer in a transaction
54 */
55 function buffer();
56
57 /**
58 * Commit
59 */
60 function flush();
61
62 /**
63 * Rollback
64 */
65 function discard();
66 }