Contents

Tailor\Classes\Blueprint\HasDatasources


Protected Properties

protected string $datasource

datasource is the data source for the model, a directory path.

protected string $datasourceTheme

datasourceTheme is the theme directory name, used to filter blueprints.

protected static array|null $resolvedPlugins

protected static array|null $resolvedActiveTheme

protected static array|null $resolvedThemes


Public Methods

public getDatasourceTheme()

public getDatasourceTheme(): void

public static getPluginDatasources()

public static getPluginDatasources(): array 

getPluginDatasources returns the blueprint directories provided by plugins, keyed by plugin code.

public static inDatasource()

public static inDatasource($path, $theme = null): void

inDatasource prepares the datasource for the model.

public static resetDatasourceCache()

public static resetDatasourceCache(): void 

resetDatasourceCache clears the memoized datasource discovery results, forcing the next listInProject call to resolve plugins and themes again.

Protected Methods

protected static getActiveThemeCodes()

protected static getActiveThemeCodes(): array 

getActiveThemeCodes returns the active theme code with its parent theme code, if any

protected static getDefaultActiveTheme()

protected static getDefaultActiveTheme(): void

getDefaultActiveTheme returns the active theme and its parent as datasources, where the child theme takes priority over the parent.

protected static getDefaultPlugins()

protected static getDefaultPlugins(): void

protected static getDefaultThemes()

protected static getDefaultThemes(): void

getDefaultThemes returns all non-active themes as datasources

protected static themeHasDbBlueprints()

protected static themeHasDbBlueprints($themeCode): bool 

themeHasDbBlueprints returns true when the theme has its database layer enabled and active SourceFile rows exist for its blueprint source.