autoload; cache; tests;
[m6w6/pq-gateway] / lib / pq / Gateway / Table / CacheInterface.php
diff --git a/lib/pq/Gateway/Table/CacheInterface.php b/lib/pq/Gateway/Table/CacheInterface.php
new file mode 100644 (file)
index 0000000..c06b11b
--- /dev/null
@@ -0,0 +1,30 @@
+<?php
+
+namespace pq\Gateway\Table;
+
+interface CacheInterface
+{
+       /**
+        * Set an item
+        * @param string $key
+        * @param mixed $val
+        * @param int $ttl
+        * @return \pq\Gateway\Table\CacheInterface
+        */
+       function set($key, $val, $ttl = 0);
+       
+       /**
+        * Get an item
+        * @param string $key
+        * @param bool $exists
+        * @return mixed
+        */
+       function get($key, &$exists = null);
+       
+       /**
+        * Delete an item
+        * @param string $key
+        * @return \pq\Gateway\Table\CacheInterface
+        */
+       function del($key);
+}