October\Rain\Halcyon\Datasource\AutoDatasource
Overview
AutoDatasource loads templates from multiple data sources
Extends
Implements
- October\Rain\Halcyon\Datasource\DatasourceInterface
Protected Properties
protected array $datasources
protected Datasource $primaryDatasource
Show inherited protected properties
Inherited Protected Properties
- $forceDeleting - indicates if the record is currently being force deleted. (defined in October\Rain\Halcyon\Datasource\Datasource)
- $postProcessor - (defined in October\Rain\Halcyon\Datasource\Datasource)
- $emitterSingleEventCollection - of events to be fired once only. (defined in October\Rain\Halcyon\Datasource\Datasource)
- $emitterEventCollection - of all registered events. (defined in October\Rain\Halcyon\Datasource\Datasource)
- $emitterEventSorted - collection. (defined in October\Rain\Halcyon\Datasource\Datasource)
Public Methods
public __construct()
public __construct($datasources): void
__construct create a new datasource instance
public delete()
public delete($dirName, $fileName, $extension): bool
delete against the datasource
public forceDelete()
public forceDelete($dirName, $fileName, $extension): bool
forceDelete against the datasource, forcing the complete removal of the template
public forceDeleteModelAtIndex()
public forceDeleteModelAtIndex($index, $model): bool
deleteModelAtIndex against a specific datasource index
public hasIndex()
public hasIndex($index): void
hasIndex returns true if the specified index exists in datasources
public hasModelAtIndex()
public hasModelAtIndex($index, $model): bool
public hasTemplate()
public hasTemplate($dirName, $fileName, $extension): bool
hasTemplate checks if a template is found in the datasource
public insert()
public insert($dirName, $fileName, $extension, $content): bool
insert creates a new template
public lastModified()
public lastModified($dirName, $fileName, $extension): int|null
lastModified returns the last modified date of an object
public makeCacheKey()
public makeCacheKey($name = ''): string
makeCacheKey unique to this datasource
public select()
public select($dirName, $options = []): array
select returns all templates
public selectOne()
public selectOne($dirName, $fileName, $extension): void
selectOne returns a single template
public update()
public update(
$dirName,
$fileName,
$extension,
$content,
$oldFileName = null,
$oldExtension = null
): int
update an existing template
public updateModelAtIndex()
public updateModelAtIndex($index, $model): int
updateModelAtIndex updates at a specific datasource index
Inherited Public Methods
- bindEvent() - creates a new event binding. (defined in October\Rain\Halcyon\Datasource\Datasource)
- bindEventOnce() - creates a new event binding that fires once only. (defined in October\Rain\Halcyon\Datasource\Datasource)
- fireEvent() - and call the listeners. (defined in October\Rain\Halcyon\Datasource\Datasource)
- getPostProcessor() - used by the connection. (defined in October\Rain\Halcyon\Datasource\Datasource)
- unbindEvent() - destroys an event binding. (defined in October\Rain\Halcyon\Datasource\Datasource)
Protected Methods
protected getDbDatasource()
protected getDbDatasource(): October\Rain\Halcyon\Datasource\DbDatasource|null
getDbDatasource returns the primary datasource when it is a DbDatasource
protected getTrashedFileNames()
protected getTrashedFileNames($dirName, $options = []): array
getTrashedFileNames returns tombstoned file names from the primary DbDatasource
protected isTemplateTrashed()
protected isTemplateTrashed($dirName, $fileName, $extension): bool
isTemplateTrashed checks if the primary DbDatasource has a tombstoned record
Show inherited protected methods
Inherited Protected Methods
- emitterEventSortEvents() - sorts the listeners for a given event by priority. (defined in October\Rain\Halcyon\Datasource\Datasource)