Documentation

DatasourceInterface

Table of Contents

delete()  : bool
Run a delete statement against the datasource.
forceDelete()  : bool
Run a delete statement against the datasource, forcing the complete removal of the template
getAvailablePaths()  : array<string|int, mixed>
Get all available paths within this datastore
getPathsCacheKey()  : string
Generate a paths cache key unique to this datasource
insert()  : bool
Creates a new template.
lastModified()  : int
Return the last modified date of an object
makeCacheKey()  : string
Generate a cache key unique to this datasource.
select()  : array<string|int, mixed>
Returns all templates.
selectOne()  : mixed
Returns a single template.
update()  : int
Updates an existing template.

Methods

delete()

Run a delete statement against the datasource.

public delete(string $dirName, string $fileName, string $extension) : bool
Parameters
$dirName : string
$fileName : string
$extension : string
Return values
bool

forceDelete()

Run a delete statement against the datasource, forcing the complete removal of the template

public forceDelete(string $dirName, string $fileName, string $extension) : bool
Parameters
$dirName : string
$fileName : string
$extension : string
Return values
bool

getAvailablePaths()

Get all available paths within this datastore

public getAvailablePaths() : array<string|int, mixed>
Return values
array<string|int, mixed>

$paths ['path/to/file1.md' => true (path can be handled and exists), 'path/to/file2.md' => false (path can be handled but doesn't exist)]

getPathsCacheKey()

Generate a paths cache key unique to this datasource

public getPathsCacheKey() : string
Return values
string

insert()

Creates a new template.

public insert(string $dirName, string $fileName, string $extension, array<string|int, mixed> $content) : bool
Parameters
$dirName : string
$fileName : string
$extension : string
$content : array<string|int, mixed>
Return values
bool

lastModified()

Return the last modified date of an object

public lastModified(string $dirName, string $fileName, string $extension) : int
Parameters
$dirName : string
$fileName : string
$extension : string
Return values
int

makeCacheKey()

Generate a cache key unique to this datasource.

public makeCacheKey([string $name = '' ]) : string
Parameters
$name : string = ''
Return values
string

select()

Returns all templates.

public select(string $dirName[, array<string|int, mixed> $options = [] ]) : array<string|int, mixed>
Parameters
$dirName : string
$options : array<string|int, mixed> = []
Return values
array<string|int, mixed>

selectOne()

Returns a single template.

public selectOne(string $dirName, string $fileName, string $extension) : mixed
Parameters
$dirName : string
$fileName : string
$extension : string
Return values
mixed

update()

Updates an existing template.

public update(string $dirName, string $fileName, string $extension, array<string|int, mixed> $content[, string $oldFileName = null ][, string $oldExtension = null ]) : int
Parameters
$dirName : string
$fileName : string
$extension : string
$content : array<string|int, mixed>
$oldFileName : string = null

Defaults to null

$oldExtension : string = null

Defaults to null

Return values
int

Search results