Blueprint represents a blueprint file object


Public Properties

public array $attributes

attributes for the template, taken from the config

public string $fileName

fileName specifies the file name corresponding the Blueprint object

public string $mtime

mtime last modified time

public string $content

content of file

public bool $exists

exists indicates if the model exists.

Show inherited public properties

Inherited Public Properties

Protected Properties

protected string $typeName

typeName of the blueprint

protected string $originalFileName

originalFileName specifies the file name that the template was originally loaded

protected array $allowedExtensions

allowedExtensions for template files

protected static static $defaultDatasource

defaultDatasource is used by unit tests.

protected static array $booted

booted models

protected static array $resolvedPlugins

protected string $datasource

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

Show inherited protected properties

Inherited Protected Properties

Public Methods

public __construct()

public __construct($attributes = []): void

public __get()

public __get($key): void

__get attributes on the model

public __isset()

public __isset($key): void

__isset determines if an attribute exists on the model

public __set()

public __set($key, $value): void

__set attributes on the model

public __unset()

public __unset($key): void

__unset an attribute on the model

public delete()

public delete(): void

delete template

public find()

public find($fileName): void

find a single template by its file name.

public forceSave()

public forceSave(): void

public get()

public get($options = []): array 

get all blueprints and uses simple objects

Available options:

  • recursive: search subfolders and place in 'templates' key
  • flatten: produce a flat array instead of a recursive array
  • filterPath: only include within an inner path
  • filterFiles: only include files
  • filterFolders: only include folders
  • filterEditable: only show editable templates

public getBasePath()

public getBasePath(): string 

getBasePath returns the base path for these objects

public getContentTableName()

public getContentTableName(): string 

public getFilePath()

public getFilePath($fileName = null): string 

getFilePath returns the absolute file path of an template

public getJoinTableName()

public getJoinTableName(): string 

public getMessage()

public getMessage($name, $default = null, $vars = []): string 

getMessage looks up a custom message from the blueprint

public getMetaData()

public getMetaData(): array 

getMetaData returns meta data for the content schema table

public static getMtimeByName()

public static getMtimeByName($fileName): int|null 

public getPermissionCodeName()

public getPermissionCodeName($name = null): string 

public getRepeaterTableName()

public getRepeaterTableName(): string 

public static hydrate()

public static hydrate($items): Tailor\Classes\BlueprintCollection 

hydrate a collection of templates from plain arrays

public static inDatasource()

public static inDatasource($path): void

inDatasource prepares the datasource for the model.

public static listInProject()

public static listInProject($options = ]): [Tailor\Classes\BlueprintCollection 

listInProject lists all blueprints in a project (app and plugins)

public static load()

public static load($fileName): Tailor\Classes\Blueprint|null 

load the object from a file

public newCollection()

public newCollection($templates = ]): [Tailor\Classes\BlueprintCollection 

newCollection instance

public static newFromIndexer()

public static newFromIndexer($attributes = []): void

newFromIndexer creates a new instance from the indexer

public promoteToTypeClass()

public promoteToTypeClass(): void

public save()

public save($options = null): void

save the object to the disk

public static setDefaultDatasource()

public static setDefaultDatasource($path): void

public toArray()

public toArray(): array 

toArray converts this instance to an array

public validate()

public validate(): void

validate the blueprint

Show inherited public methods

Inherited Public Methods

Protected Methods

protected static boot()

protected static boot(): void

boot is the "booting" method of the model.

protected static bootDefaultPlugins()

protected static bootDefaultPlugins(): void

protected bootIfNotBooted()

protected bootIfNotBooted(): void

bootIfNotBooted checks if the model needs to be booted and if so, do it.

protected getInternal()

protected getInternal($path): array 

getInternal helps the get method

protected getRelativePath()

protected getRelativePath($path): string 

getRelativePath returns path relative to the theme template directory

protected invalidYamlParse()

protected invalidYamlParse($content): void

protected makeBlueprintTableName()

protected makeBlueprintTableName($type = 'content'): string 

makeBlueprintTableName where type can be used for content, join or repeater

protected validateFileName()

protected validateFileName(string $fileName = null): void 

validateFileName extension and path.

Show inherited protected methods

Inherited Protected Methods