PluginBaseModel
extends PluginYamlModel
in package
Manages plugin basic information.
Tags
Table of Contents
- $author : mixed
- $author_namespace : mixed
- $description : mixed
- $exists : bool
- $homepage : mixed
- $icon : mixed
- $name : mixed
- $namespace : mixed
- $fillable : mixed
- $localizedDescription : mixed
- $localizedName : mixed
- $originalFileData : mixed
- $originalFilePath : mixed
- $pluginCodeObj : PluginCode
- $pluginName : mixed
- $updatedData : mixed
- $validationMessages : mixed
- $validationRules : mixed
- $yamlSection : mixed
- deleteModel() : mixed
- fill() : mixed
- getIconOptions() : mixed
- getModelPluginName() : mixed
- getPluginCode() : mixed
- getPluginCodeObj() : mixed
- getPluginName() : mixed
- initDefaults() : mixed
- isNewModel() : mixed
- listAllPluginCodes() : mixed
- loadPlugin() : mixed
- save() : mixed
- setPluginCode() : mixed
- Sets a string code of a plugin the model is associated with
- setPluginCodeObj() : mixed
- Sets a code object of a plugin the model is associated with
- validate() : mixed
- afterCreate() : mixed
- beforeCreate() : mixed
- forcePluginRegistration() : mixed
- getArrayKeySafe() : mixed
- getFilePath() : string
- Returns a file path to save the model to.
- getPluginPath() : mixed
- getPluginPathObj() : mixed
- initBuilderSettings() : mixed
- initPluginStructure() : mixed
- initPropertiesFromPluginCodeObject() : mixed
- load() : mixed
- loadCommonProperties() : mixed
- modelToYamlArray() : array<string|int, mixed>
- Converts the model's data to an array before it's saved to a YAML file.
- pluginSettingsFileExists() : mixed
- rollbackPluginCreation() : mixed
- sanitizePHPString() : mixed
- validateBeforeCreate() : mixed
- yamlArrayToModel() : mixed
- Load the model's data from an array.
Properties
$author
public
mixed
$author
$author_namespace
public
mixed
$author_namespace
$description
public
mixed
$description
$exists
public
bool
$exists
= false
This property is used by the system internally.
$homepage
public
mixed
$homepage
$icon
public
mixed
$icon
$name
public
mixed
$name
$namespace
public
mixed
$namespace
$fillable
protected
static mixed
$fillable
= ['name', 'author', 'namespace', 'author_namespace', 'description', 'icon', 'homepage']
$localizedDescription
protected
mixed
$localizedDescription
$localizedName
protected
mixed
$localizedName
$originalFileData
protected
mixed
$originalFileData
= []
$originalFilePath
protected
mixed
$originalFilePath
$pluginCodeObj
protected
PluginCode
$pluginCodeObj
= null
The plugin code object the model is associated with.
$pluginName
protected
mixed
$pluginName
$updatedData
protected
mixed
$updatedData
= []
$validationMessages
protected
mixed
$validationMessages
= []
$validationRules
protected
mixed
$validationRules
= ['name' => 'required', 'author' => ['required'], 'namespace' => ['required', 'regex:/^[a-z]+[a-z0-9]+$/i', 'reserved'], 'author_namespace' => ['required', 'regex:/^[a-z]+[a-z0-9]+$/i', 'reserved'], 'homepage' => 'url']
$yamlSection
protected
mixed
$yamlSection
= "plugin"
Methods
deleteModel()
public
deleteModel() : mixed
Return values
mixed —fill()
public
fill(array<string|int, mixed> $attributes) : mixed
Parameters
- $attributes : array<string|int, mixed>
Return values
mixed —getIconOptions()
public
getIconOptions() : mixed
Return values
mixed —getModelPluginName()
public
getModelPluginName() : mixed
Return values
mixed —getPluginCode()
public
getPluginCode() : mixed
Return values
mixed —getPluginCodeObj()
public
getPluginCodeObj() : mixed
Return values
mixed —getPluginName()
public
getPluginName() : mixed
Return values
mixed —initDefaults()
public
initDefaults() : mixed
Return values
mixed —isNewModel()
public
isNewModel() : mixed
Return values
mixed —listAllPluginCodes()
public
static listAllPluginCodes() : mixed
Return values
mixed —loadPlugin()
public
loadPlugin(mixed $pluginCode) : mixed
Parameters
- $pluginCode : mixed
Return values
mixed —save()
public
save() : mixed
Return values
mixed —setPluginCode()
Sets a string code of a plugin the model is associated with
public
setPluginCode(string $code) : mixed
Parameters
- $code : string
-
Specifies the plugin code
Return values
mixed —setPluginCodeObj()
Sets a code object of a plugin the model is associated with
public
setPluginCodeObj(PluginCode $obj) : mixed
Parameters
- $obj : PluginCode
-
Specifies the plugin code object
Return values
mixed —validate()
public
validate() : mixed
Return values
mixed —afterCreate()
protected
afterCreate() : mixed
Return values
mixed —beforeCreate()
protected
beforeCreate() : mixed
Return values
mixed —forcePluginRegistration()
protected
forcePluginRegistration() : mixed
Return values
mixed —getArrayKeySafe()
protected
getArrayKeySafe(mixed $array, mixed $key[, mixed $default = null ]) : mixed
Parameters
- $array : mixed
- $key : mixed
- $default : mixed = null
Return values
mixed —getFilePath()
Returns a file path to save the model to.
protected
getFilePath() : string
Return values
string —Returns a path.
getPluginPath()
protected
getPluginPath() : mixed
Return values
mixed —getPluginPathObj()
protected
getPluginPathObj() : mixed
Return values
mixed —initBuilderSettings()
protected
initBuilderSettings() : mixed
Return values
mixed —initPluginStructure()
protected
initPluginStructure() : mixed
Return values
mixed —initPropertiesFromPluginCodeObject()
protected
initPropertiesFromPluginCodeObject(mixed $pluginCodeObj) : mixed
Parameters
- $pluginCodeObj : mixed
Return values
mixed —load()
protected
load(mixed $filePath) : mixed
Parameters
- $filePath : mixed
Return values
mixed —loadCommonProperties()
protected
loadCommonProperties() : mixed
Return values
mixed —modelToYamlArray()
Converts the model's data to an array before it's saved to a YAML file.
protected
modelToYamlArray() : array<string|int, mixed>
Return values
array<string|int, mixed> —pluginSettingsFileExists()
protected
static pluginSettingsFileExists(mixed $pluginCodeObj) : mixed
Parameters
- $pluginCodeObj : mixed
Return values
mixed —rollbackPluginCreation()
protected
rollbackPluginCreation() : mixed
Return values
mixed —sanitizePHPString()
protected
sanitizePHPString(mixed $str) : mixed
Parameters
- $str : mixed
Return values
mixed —validateBeforeCreate()
protected
validateBeforeCreate() : mixed
Return values
mixed —yamlArrayToModel()
Load the model's data from an array.
protected
yamlArrayToModel(array<string|int, mixed> $array) : mixed
Parameters
- $array : array<string|int, mixed>
-
An array to load the model fields from.