X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=lib%2Fpq%2FMapper%2FStorageInterface.php;h=eb75f633b63fdfe9d2ce375a71ec60d719c4b5b2;hb=5c080bb03b5fee867da94cb3c1108d59529f741a;hp=db16df52f7504f662e8b7e8117c7356d68ab2410;hpb=e6da4c7430e5c5b4ba482206e42aeebb4363d2b3;p=m6w6%2Fpq-gateway diff --git a/lib/pq/Mapper/StorageInterface.php b/lib/pq/Mapper/StorageInterface.php index db16df5..eb75f63 100644 --- a/lib/pq/Mapper/StorageInterface.php +++ b/lib/pq/Mapper/StorageInterface.php @@ -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(); +}