PHP Class JamesMoss\Flywheel\NestedRepository

Inheritance: extends Repository
Show file Open project: jamesmoss/flywheel Class Usage Examples

Public Methods

Method Description
__construct ( $name, Config $config )
delete ( $id )
getAllFiles ( ) : array Get an array containing the path of all files in this repository
getFilename ( string $id ) : string Gets just the filename for a document based on it's ID.
getPathForDocument ( string $id ) : string Get the filesystem path for a document based on it's ID.

Protected Methods

Method Description
getFilesRecursive ( $dir, array &$result, $ext )
getIdFromPath ( $path, $ext )
isNestedId ( $id )
validateId ( string $id ) : boolean Checks to see if a document ID is valid
write ( $path, $contents )

Method Details

__construct() public method

public __construct ( $name, Config $config )
$config Config

delete() public method

public delete ( $id )

getAllFiles() public method

Get an array containing the path of all files in this repository
public getAllFiles ( ) : array
return array An array, item is a file path.

getFilename() public method

Gets just the filename for a document based on it's ID.
public getFilename ( string $id ) : string
$id string The ID of the document.
return string The filename of the document, including extension.

getFilesRecursive() protected method

protected getFilesRecursive ( $dir, array &$result, $ext )
$result array

getIdFromPath() protected method

protected getIdFromPath ( $path, $ext )

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.

isNestedId() protected method

protected isNestedId ( $id )

validateId() protected method

Checks to see if a document ID is valid
protected validateId ( string $id ) : boolean
$id string The ID to check
return boolean True if valid, otherwise false

write() protected method

protected write ( $path, $contents )