phpdoc
[m6w6/pq-gateway] / lib / pq / Mapper / Storage.php
index 8e0fcb4df7b20f8b8347e8e241e3c9626f180820..8016ef8b8cc13693ce368241f4c3f199d860ef6a 100644 (file)
@@ -2,39 +2,61 @@
 
 namespace pq\Mapper;
 
+use pq\Gateway\Table;
+
 class Storage implements StorageInterface
 {
        /**
-        *
-        * @var pq\Mapper\MapInterface
+        * The mapping of this storage
+        * @var MapInterface
         */
-       private $map;
+       var $map;
 
        /**
-        * @var \pq\Gateway\Table
+        * The underlying table gateway
+        * @var Table
         */
        private $gateway;
-       
+
+       /**
+        * Create a storage for $map
+        * @param MapInterface $map
+        */
        function __construct(MapInterface $map) {
                $this->map = $map;
                $this->gateway = $map->getGateway();
        }
-       
+
+       /**
+        * Find
+        * @param array $where
+        * @param string $order
+        * @param int $limit
+        * @param int $offset
+        * @return object[]
+        */
        function find($where = [], $order = null, $limit = null, $offset = null) {
                /* @var pq\Gateway\Rowset $rowset */
                $rowset = $this->gateway->find($where, $order, $limit, $offset);
                return $this->map->mapAll($rowset);
        }
-       
+
+       /**
+        * Delete
+        * @param object $object
+        */
        function delete($object) {
                $cache = $this->map->getObjects();
                $row = $cache->asRow($object)->delete();
                $cache->resetObject($row);
                $cache->resetRow($object);
        }
-       
+
+       /**
+        * Save
+        * @param object $object
+        */
        function save($object) {
                $this->map->unmap($object);
        }
-       
-}
\ No newline at end of file
+}