Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / Cache / Storage / StorageInterface.php
blobf1fb22b10ea21dc65e675113ffac8ea67469f4f1
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\Cache\Storage;
12 use Traversable;
14 interface StorageInterface
16 /**
17 * Set options.
19 * @param array|Traversable|Adapter\AdapterOptions $options
20 * @return StorageInterface Fluent interface
22 public function setOptions($options);
24 /**
25 * Get options
27 * @return Adapter\AdapterOptions
29 public function getOptions();
31 /* reading */
33 /**
34 * Get an item.
36 * @param string $key
37 * @param bool $success
38 * @param mixed $casToken
39 * @return mixed Data on success, null on failure
40 * @throws \Zend\Cache\Exception\ExceptionInterface
42 public function getItem($key, & $success = null, & $casToken = null);
44 /**
45 * Get multiple items.
47 * @param array $keys
48 * @return array Associative array of keys and values
49 * @throws \Zend\Cache\Exception\ExceptionInterface
51 public function getItems(array $keys);
53 /**
54 * Test if an item exists.
56 * @param string $key
57 * @return bool
58 * @throws \Zend\Cache\Exception\ExceptionInterface
60 public function hasItem($key);
62 /**
63 * Test multiple items.
65 * @param array $keys
66 * @return array Array of found keys
67 * @throws \Zend\Cache\Exception\ExceptionInterface
69 public function hasItems(array $keys);
71 /**
72 * Get metadata of an item.
74 * @param string $key
75 * @return array|bool Metadata on success, false on failure
76 * @throws \Zend\Cache\Exception\ExceptionInterface
78 public function getMetadata($key);
80 /**
81 * Get multiple metadata
83 * @param array $keys
84 * @return array Associative array of keys and metadata
85 * @throws \Zend\Cache\Exception\ExceptionInterface
87 public function getMetadatas(array $keys);
89 /* writing */
91 /**
92 * Store an item.
94 * @param string $key
95 * @param mixed $value
96 * @return bool
97 * @throws \Zend\Cache\Exception\ExceptionInterface
99 public function setItem($key, $value);
102 * Store multiple items.
104 * @param array $keyValuePairs
105 * @return array Array of not stored keys
106 * @throws \Zend\Cache\Exception\ExceptionInterface
108 public function setItems(array $keyValuePairs);
111 * Add an item.
113 * @param string $key
114 * @param mixed $value
115 * @return bool
116 * @throws \Zend\Cache\Exception\ExceptionInterface
118 public function addItem($key, $value);
121 * Add multiple items.
123 * @param array $keyValuePairs
124 * @return array Array of not stored keys
125 * @throws \Zend\Cache\Exception\ExceptionInterface
127 public function addItems(array $keyValuePairs);
130 * Replace an existing item.
132 * @param string $key
133 * @param mixed $value
134 * @return bool
135 * @throws \Zend\Cache\Exception\ExceptionInterface
137 public function replaceItem($key, $value);
140 * Replace multiple existing items.
142 * @param array $keyValuePairs
143 * @return array Array of not stored keys
144 * @throws \Zend\Cache\Exception\ExceptionInterface
146 public function replaceItems(array $keyValuePairs);
149 * Set an item only if token matches
151 * It uses the token received from getItem() to check if the item has
152 * changed before overwriting it.
154 * @param mixed $token
155 * @param string $key
156 * @param mixed $value
157 * @return bool
158 * @throws \Zend\Cache\Exception\ExceptionInterface
159 * @see getItem()
160 * @see setItem()
162 public function checkAndSetItem($token, $key, $value);
165 * Reset lifetime of an item
167 * @param string $key
168 * @return bool
169 * @throws \Zend\Cache\Exception\ExceptionInterface
171 public function touchItem($key);
174 * Reset lifetime of multiple items.
176 * @param array $keys
177 * @return array Array of not updated keys
178 * @throws \Zend\Cache\Exception\ExceptionInterface
180 public function touchItems(array $keys);
183 * Remove an item.
185 * @param string $key
186 * @return bool
187 * @throws \Zend\Cache\Exception\ExceptionInterface
189 public function removeItem($key);
192 * Remove multiple items.
194 * @param array $keys
195 * @return array Array of not removed keys
196 * @throws \Zend\Cache\Exception\ExceptionInterface
198 public function removeItems(array $keys);
201 * Increment an item.
203 * @param string $key
204 * @param int $value
205 * @return int|bool The new value on success, false on failure
206 * @throws \Zend\Cache\Exception\ExceptionInterface
208 public function incrementItem($key, $value);
211 * Increment multiple items.
213 * @param array $keyValuePairs
214 * @return array Associative array of keys and new values
215 * @throws \Zend\Cache\Exception\ExceptionInterface
217 public function incrementItems(array $keyValuePairs);
220 * Decrement an item.
222 * @param string $key
223 * @param int $value
224 * @return int|bool The new value on success, false on failure
225 * @throws \Zend\Cache\Exception\ExceptionInterface
227 public function decrementItem($key, $value);
230 * Decrement multiple items.
232 * @param array $keyValuePairs
233 * @return array Associative array of keys and new values
234 * @throws \Zend\Cache\Exception\ExceptionInterface
236 public function decrementItems(array $keyValuePairs);
238 /* status */
241 * Capabilities of this storage
243 * @return Capabilities
245 public function getCapabilities();