phpdoc
[m6w6/pq-gateway] / lib / pq / Mapper / PropertyInterface.php
1 <?php
2
3 namespace pq\Mapper;
4
5 use pq\Gateway\Row;
6
7 interface PropertyInterface
8 {
9 /**
10 * Write the value for the property from $object into the row to update
11 * @param object $object
12 * @param Row $rowToUpdate
13 * @return null|callable eventual deferred callback
14 */
15 function write($object, Row $rowToUpdate);
16
17 /**
18 * Read the value for the property from $row into the mapped object
19 * @param Row $row
20 * @param object $objectToUpdate
21 * @return null|callable eventual deferred callback
22 */
23 function read(Row $row, $objectToUpdate);
24
25 /**
26 * Set the value of the mapped property
27 * @param object $object
28 * @param mixed $value
29 */
30 function assign($object, $value);
31
32 /**
33 * Get the value of the mapped property
34 * @param object $object
35 * @return mixed
36 */
37 function extract($object);
38
39 /**
40 * Get the property name
41 * @return string
42 */
43 function getProperty();
44
45 /**
46 * Get the containing map
47 * @return MapInterface
48 */
49 function getContainer();
50
51 /**
52 * Set the containing map
53 * @param MapInterface $container
54 * @return Property
55 */
56 function setContainer(MapInterface $container);
57
58 /**
59 * Check whether this Property defines $property
60 * @param string $property
61 * @return bool
62 */
63 function defines($property);
64
65 /**
66 * Check whether this property exposes $field
67 * @param string $field
68 * @return bool
69 */
70 function exposes($field);
71 }