PHP Class JamesMoss\Flywheel\NestedRepository

Inheritance: extends Repository
Afficher le fichier Open project: jamesmoss/flywheel Class Usage Examples

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode 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 méthode

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

delete() public méthode

public delete ( $id )

getAllFiles() public méthode

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

getFilename() public méthode

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

getFilesRecursive() protected méthode

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

getIdFromPath() protected méthode

protected getIdFromPath ( $path, $ext )

getPathForDocument() public méthode

Get the filesystem path for a document based on it's ID.
public getPathForDocument ( string $id ) : string
$id string The ID of the document.
Résultat string The full filesystem path of the document.

isNestedId() protected méthode

protected isNestedId ( $id )

validateId() protected méthode

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

write() protected méthode

protected write ( $path, $contents )