Newscoop\Storage::fetchItem PHP Method

fetchItem() public method

Fetch item
public fetchItem ( string $key ) : mixed
$key string
return 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
ファイル: Template.php プロジェクト: sourcefabric/newscoop
 /**
  * Fetch item
  *
  * @param string $key
  * @return string
  */
 public function fetchItem($key)
 {
     return $this->storage->fetchItem($key);
 }