October\Rain\Halcyon\Datasource\FileDatasource

Source: ~/vendor/october/rain/src/Halcyon/Datasource/FileDatasource.php

Extends:

Implements:

File based datasource.

Protected properties

protected string $basePath

The local path where the datasource can be found.

protected October\Rain\Filesystem\Filesystem $files

The filesystem instance.

Show inherited protected properties

Inherited protected properties

Public methods

public void __construct(string $container, array $config)

Create a new datasource instance.

Parameters
  • string $container
  • array $config

public int delete(string $dirName, string $fileName, $extension)

Run a delete statement against the datasource.

Parameters
  • string $dirName
  • string $fileName
  • $extension

public string getBasePath()

Returns the base path for this datasource.

public bool insert(string $dirName, string $fileName, array $content, $content)

Creates a new template.

Parameters
  • string $dirName
  • string $fileName
  • array $content
  • $content

public int lastModified(string $dirName, string $fileName, $extension)

Run a delete statement against the datasource.

Parameters
  • string $dirName
  • string $fileName
  • $extension

public string makeCacheKey($name='')

Generate a cache key unique to this datasource.

Parameters
  • $name

public array select(string $dirName, $options=array())

Returns all templates.

Parameters
  • string $dirName
  • $options

public mixed selectOne(string $dirName, string $fileName, $extension)

Returns a single template.

Parameters
  • string $dirName
  • string $fileName
  • $extension

public int update(string $dirName, string $fileName, array $content, $content, $oldFileName=NULL, $oldExtension=NULL)

Updates an existing template.

Parameters
  • string $dirName
  • string $fileName
  • array $content
  • $content
  • $oldFileName
  • $oldExtension

Show inherited public methods

Inherited public methods

Protected methods

protected string makeFilePath($dirName, $fileName, $extension)

Helper to make file path.

Parameters
  • $dirName
  • $fileName
  • $extension

protected void validateDirectoryForSave($dirName, $fileName, $extension)

Ensure the requested file can be created in the requested directory.

Parameters
  • $dirName
  • $fileName
  • $extension