phpdoc
[m6w6/pq-gateway] / lib / pq / Mapper / Property / Field.php
index 7a5774102f19c11f8859e7282915ff3e29f310cd..78c500bb02b18b208f34302ae9beac49a84db34b 100644 (file)
@@ -2,8 +2,8 @@
 
 namespace pq\Mapper\Property;
 
+use pq\Gateway\Cell;
 use pq\Gateway\Row;
-
 use pq\Mapper\Mapper;
 use pq\Mapper\Property;
 use pq\Mapper\PropertyInterface;
@@ -12,18 +12,34 @@ class Field implements PropertyInterface
 {
        use Property;
 
+       /**
+        * Create a simple field mapping
+        * @param Mapper $mapper
+        * @param string $property
+        * @param string $field
+        */
        function __construct(Mapper $mapper, $property, $field = null) {
                $this->mapper = $mapper;
                $this->property = $property;
                $this->field = $field ?: $property;
        }
 
+       /**
+        * Read property value
+        * @param Row $row
+        * @param object $objectToUpdate
+        */
        function read(Row $row, $objectToUpdate) {
-               /* @var $val \pq\Gateway\Cell */
+               /* @var $val Cell */
                $val = $row->{$this->field};
                $this->assign($objectToUpdate, $val->get());
        }
 
+       /**
+        * Write property value
+        * @param object $object
+        * @param Row $rowToUpdate
+        */
        function write($object, Row $rowToUpdate) {
                $val = $this->extract($object);
                $rowToUpdate->{$this->field} = $val;