cleanups
[m6w6/pq-gateway] / lib / pq / Mapper / MapInterface.php
1 <?php
2
3 namespace pq\Mapper;
4
5 use pq\Gateway\Row;
6 use pq\Gateway\Rowset;
7 use pq\Gateway\Table;
8
9 interface MapInterface
10 {
11 /**
12 * @return string
13 */
14 function getClass();
15
16 /**
17 * @return Table
18 */
19 function getGateway();
20
21 /**
22 * @return array of PropertyInterface instances
23 */
24 function getProperties();
25
26 /**
27 * @param PropertyInterface $property
28 */
29 function addProperty(PropertyInterface $property);
30
31 /**
32 * @param Row $row
33 * @param string $refName
34 * @param array $objects
35 * @return Rowset
36 */
37 function allOf(Row $row, $refName, &$objects = null);
38
39 /**
40 * @param Row $row
41 * @param string $refName
42 * @param array $objects
43 * @return Rowset
44 */
45 function refOf(Row $row, $refName, &$objects = null);
46
47 /**
48 * @param MapInterface $map origin
49 * @param string $refName relations reference name
50 * @return array relation reference
51 */
52 function relOf(MapInterface $map, $refName);
53
54 /**
55 * @param Row $row
56 * @return object
57 */
58 function map(Row $row);
59
60 /**
61 * @param Rowset $rows
62 * @return array
63 */
64 function mapAll(Rowset $rows);
65
66 /**
67 * @param object $object
68 * @return Row
69 */
70 function unmap($object);
71 }