Newscoop\Storage::fetchItem PHP Метод

fetchItem() публичный Метод

Fetch item
public fetchItem ( string $key ) : mixed
$key string
Результат mixed
    public function fetchItem($key)
    {
        $path = $this->getPath($key, TRUE);
        if (!$path) {
            return null;
        }
        if (is_dir($path)) {
            throw new \InvalidArgumentException($key, self::ERROR_NOT_FILE);
        }
        return file_get_contents($path);
    }

Usage Example

Пример #1
0
 /**
  * Fetch item
  *
  * @param string $key
  * @return string
  */
 public function fetchItem($key)
 {
     return $this->storage->fetchItem($key);
 }