Generate a pathname for an ID

@param string $id ID

@return string
484599
protected function generatePathname($id)
    {
        if (!file_exists($this->basePath)) {
            mkdir($this->basePath, 0777, true);
        }

        return $this->basePath.'/'.$id;
    }
7311
protected function setResourceId($id)
    {
        $path = Config::get('nova.path');
        // If the path is the site route, prevent a double-slash
        if ('/' === $path) {
            $path = '';
        }
        return $this->withMeta(['id' => $id, 'nova_path' => $path]);
    }
1333462
protected function prepareUniqueId($id)
    {
        if (preg_match('/\[(.*)\]/', $id, $matches)) {
            $id = $this->getValue($matches[1]);
        }

        if (strtolower($id) === 'null') {
            $id = null;
        }

        if (filter_var($id, FILTER_VALIDATE_INT) !== false) {
            $id = (int) $id;
        }

        return $id;
    }
216459
public function getStatusName($id = null)
    {
        $options = $this->getStatusOptions();
        if (!isset($id)) {
            $id = $this->getStatusId();
        }
        return isset($options[$id]) ? $options[$id] : '???';
    }
894733
public static function id2dir($id = null) {
        if ($id === null) {
            return self::$maps ['id2dir'];
        }
        if (isset (self::$maps ['id2dir'] [ $id ])) {
            return self::$maps ['id2dir'] [ $id ];
        } else {
            return $id;
        }
    }
124194
public function getPath( $id )
	{
		$list = $this->manager->getPath( $id, $this->domains );

		if( $this->root )
		{
			foreach( $list as $key => $item )
			{
				if( $key == $this->root ) {
					break;
				}
				unset( $list[$key] );
			}
		}

		return $list;
	}
1157024
protected function getFilename($id, $metadata = false)
    {
        $this->assertValidId($id);
        $path = rtrim(dirname($id), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
        if ($level = $this->getOption('hash_tree', 0)) {
            $level = min(32, $level);
            $md5 = md5($id);
            for ($i = 0; $i < $level; ++$i) {
                $path .= $md5[$i] . DIRECTORY_SEPARATOR;
            }
        }
        $path .= basename($id);
        if ($metadata) {
            $root = $this->getOption('metadata_root', $this->getOption('root') . DIRECTORY_SEPARATOR . '.cache_metadata');
        } else {
            $root = $this->getOption('root');
        }
        return rtrim(sanitize_path($root . DIRECTORY_SEPARATOR . $path), DIRECTORY_SEPARATOR);
    }
154378
protected function getTableName($id) {
        $className = get_class($this);
        $pos = strpos($className, '\\Model\\');

        $tableName = $pos !== FALSE ? substr($className, $pos + 7) : $className;
        $tableName = str_replace('\\', '_', trim($tableName, '//'));

        return strtolower($tableName);
    }
846025
protected function getPathForSessionId($id)
    {
        if (is_null($this->path)) {
            throw new Exception("Path not set");
        }

        return sprintf('%s/%s%s', $this->path, $this->prefix, $id);
    }
388716
private String pathToItem(String id) {
		return subDirForId(id) + UNIX_PATH_SEPERATOR + id.substring(SUBDIR_POLICY);
	}
56157
protected function _metadatasFile($id)
    {
        $path = $this->_path($id);
        $fileName = $this->_idToFileName('internal-metadatas---' . $id);
        return $path . $fileName;
    }
676199
protected function _path($id, $parts = false)
    {
        $partsArray = array();
        $root = $this->_options['cache_dir'];
        $prefix = $this->_options['file_name_prefix'];
        if ($this->_options['hashed_directory_level']>0) {
            $hash = hash('adler32', $id);
            for ($i=0 ; $i < $this->_options['hashed_directory_level'] ; $i++) {
                $root = $root . $prefix . '--' . substr($hash, 0, $i + 1) . DIRECTORY_SEPARATOR;
                $partsArray[] = $root;
            }
        }
        if ($parts) {
            return $partsArray;
        } else {
            return $root;
        }
    }
919022
private function getKey(string $id = null) : string
    {
        $id = $id ?: session_id();
        return sprintf('%s/session/%s', session_name(), $id);
    }
1248832
public function params($id)
	{
		$params = '';

		if ($this->app->has('db'))
		{
			$db = $this->app['db'];

			$query = $db->getQuery()
				->select('params')
				->from('#__modules')
				->whereEquals('published', 1);

			// Select module params based on name or ID
			if (is_numeric($id))
			{
				$query->whereEquals('id', (int) $id);
			}
			else
			{
				$query->whereEquals('module', $id);
			}

			$db->setQuery($query->toString());
			$params = $db->loadResult();
		}

		//return params
		return new Registry($params);
	}
554214
public function setName($id, $name)
    {
        return $this->put($this->getPath().'/'.rawurlencode($id).'/name', array('value' => $name));
    }
1368794
protected function normalizeId($id)
    {
        if (null !== $this->getSessionPrefix()) {
            return $this->getSessionPrefix() . self::ID_SEPARATOR . $id;
        }

        return $id;
    }
656180
public function to_path(string $id){
    if ( bbn\str::is_uid($id) ){
      return $this->options->to_path($id, '', $this->_get_public_root());
    }
    return false;
  }