You are here

public function MemcacheMock::get in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-kernel/Tests/Profiler/Mock/MemcacheMock.php \Symfony\Component\HttpKernel\Tests\Profiler\Mock\MemcacheMock::get()

Retrieve item from the server.

Parameters

string|array $key:

int|array $flags:

Return value

mixed

File

vendor/symfony/http-kernel/Tests/Profiler/Mock/MemcacheMock.php, line 169

Class

MemcacheMock
MemcacheMock for simulating Memcache extension in tests.

Namespace

Symfony\Component\HttpKernel\Tests\Profiler\Mock

Code

public function get($key, &$flags = null) {
  if (!$this->connected) {
    return false;
  }
  if (is_array($key)) {
    $result = array();
    foreach ($key as $k) {
      if (isset($this->storage[$k])) {
        $result[] = $this
          ->getData($k);
      }
    }
    return $result;
  }
  return $this
    ->getData($key);
}