| @@ 82-95 (lines=14) @@ | ||
| 79 | * |
|
| 80 | * @since 1.0 |
|
| 81 | */ |
|
| 82 | public function getItem($key) |
|
| 83 | { |
|
| 84 | $this->connect(); |
|
| 85 | $value = $this->driver->get($key); |
|
| 86 | $code = $this->driver->getResultCode(); |
|
| 87 | $item = new Item($key); |
|
| 88 | ||
| 89 | if ($code === \Memcached::RES_SUCCESS) |
|
| 90 | { |
|
| 91 | $item->set($value); |
|
| 92 | } |
|
| 93 | ||
| 94 | return $item; |
|
| 95 | } |
|
| 96 | ||
| 97 | /** |
|
| 98 | * Method to remove a storage entry for a key. |
|
| @@ 62-75 (lines=14) @@ | ||
| 59 | * |
|
| 60 | * @since 1.0 |
|
| 61 | */ |
|
| 62 | public function getItem($key) |
|
| 63 | { |
|
| 64 | $this->connect(); |
|
| 65 | ||
| 66 | $value = $this->driver->get($key); |
|
| 67 | $item = new Item($key); |
|
| 68 | ||
| 69 | if ($value !== false) |
|
| 70 | { |
|
| 71 | $item->set($value); |
|
| 72 | } |
|
| 73 | ||
| 74 | return $item; |
|
| 75 | } |
|
| 76 | ||
| 77 | /** |
|
| 78 | * Method to remove a storage entry for a key. |
|