storage test
[m6w6/pq-gateway] / lib / pq / Mapper / StorageInterface.php
index db16df52f7504f662e8b7e8117c7356d68ab2410..eb75f633b63fdfe9d2ce375a71ec60d719c4b5b2 100644 (file)
@@ -5,11 +5,46 @@ namespace pq\Mapper;
 interface StorageInterface
 {
        /**
-        * @return pq\Mapper\Mapper
+        * Find by PK
+        * @param mixed $pk
+        * @return object
         */
-       function getMapper();
+       function get($pk);
        
-       function find($where, $order = null, $limit = null, $offset = null);
+       /**
+        * Find
+        * @param array $where
+        * @param string $order
+        * @param int $limit
+        * @param int $offset
+        * @return object[]
+        */
+       function find($where = [], $order = null, $limit = null, $offset = null);
+
+       /**
+        * Delete
+        * @param object $object
+        */
        function delete($object);
-       function persist($object);
-}
\ No newline at end of file
+
+       /**
+        * Save
+        * @param object $object
+        */
+       function save($object);
+
+       /**
+        * Buffer in a transaction
+        */
+       function buffer();
+
+       /**
+        * Commit
+        */
+       function flush();
+
+       /**
+        * Rollback
+        */
+       function discard();
+}