data mapper POC
[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 * @return object
34 */
35 function map(Row $row);
36
37 /**
38 * @param \pq\Mapper\Rowset $rows
39 * @return array
40 */
41 function mapAll(Rowset $rows);
42
43 /**
44 * @param object $object
45 * @return Row
46 */
47 function unmap($object);
48 }