- public function add( $key, $value, $exptime = 0 ) {
- if ( !$this->get( $key ) ) {
- $this->set( $key, $value, $exptime );
+ /**
+ * Get an associative array containing the item for each of the keys that have items.
+ * @param $keys Array List of strings
+ * @return Array
+ */
+ public function getMulti( array $keys ) {
+ $res = array();
+ foreach ( $keys as $key ) {
+ $val = $this->get( $key );
+ if ( $val !== false ) {
+ $res[$key] = $val;
+ }
+ }
+ return $res;
+ }