JamesMoss\Flywheel\NestedRepository::getPathForDocument PHP Method

getPathForDocument() public method

Get the filesystem path for a document based on it's ID.
public getPathForDocument ( string $id ) : string
$id string The ID of the document.
return string The full filesystem path of the document.
    public function getPathForDocument($id)
    {
        if (!$this->validateId($id)) {
            throw new \Exception(sprintf('`%s` is not a valid document ID.', $id));
        }
        if ($this->isNestedId($id)) {
            $path = DIRECTORY_SEPARATOR . str_replace(self::SEPERATOR, DIRECTORY_SEPARATOR, dirname($id));
        } else {
            $path = '';
        }
        return $this->path . $path . DIRECTORY_SEPARATOR . $this->getFilename($id);
    }