Documentation

module
in package

Module base model

Tags
author

Stefan Seehafer sea75300@yahoo.de

copyright

(c) 2011-2020, Stefan Seehafer

license

http://www.gnu.org/licenses/gpl.txt GPLv3

Table of Contents

STATUS_DISABLED  = 1005
STATUS_ENABLED  = 1004
STATUS_INSTALLED  = 1001
STATUS_NOT_DISABLED  = -1005
STATUS_NOT_ENABLED  = -1004
STATUS_NOT_INSTALLED  = -1001
STATUS_NOT_UNINSTALLED  = -1002
STATUS_UNINSTALLED  = 1002
$active  : bool
Module active status
$basePath  : string
Module base path
$cache  : cache
Cache object
$config  : config
Module configuration
$db  : database
Databse object
$id  : int
Dataset id
$initDb  : bool
Initialize object from database
$installed  : bool
Module installed status
$mkey  : string
Module key
$paths  : paths
Module data paths handler
$prefix  : string
Module prefix VENDOR_KEY
$systemConfig  : config
System config object
__construct()  : bool
Konstruktor
addModule()  : bool
Add module entry to database
createDataFolder()  : bool
Create module data path
createFromDbObject()  : bool
Initialize object with database data
disable()  : bool
Disable module
enable()  : bool
Enable module
fromPath()  : paths
getConfig()  : config
Fetch module config
getConfigByKey()  : string
Get config file path
getConfigureFields()  : array<string|int, mixed>
Fetch module configuration config from configure.yml
getConfigViewVars()  : array<string|int, mixed>
Return additional vars for configure view
getControllerNamespace()  : string
Get module controller class name
getCronNamespace()  : string
Return Namespace of module cronjobs
getDataPath()  : string
Get module data path
getEventNamespace()  : string
Get module event class name
getFullPrefix()  : string
Fetch complete module prefix
getId()  : int
Fetch dataset ID
getJsDirByKey()  : string
Get JS file path
getKey()  : string
Return module key
getKeyFromClass()  : string
fetch module key from class name
getKeyFromFilename()  : string
fetch module key from filename
getKeyFromPath()  : string
fetch module key from filepath
getLanguageFileByKey()  : string
Get language file path
getLanguageVarPrefixed()  : string
Assign module language variable prefix
getMigrationNamespace()  : string
Return Namespace of module migrations
getMigrations()  : array<string|int, mixed>
Returns list of migrations
getModuleBasePathFromKey()  : string
Get base path from module
getModuleUrlFromKey()  : string
Returns root URL for module path
getOption()  : mixed
Fetch system config options
getOptions()  : array<string|int, mixed>
Fetch system config options
getStyleDirByKey()  : string
Get CSS file path
getTemplateDirByKey()  : string
Get template file path
hasConfigure()  : bool
Check if configure action should be displayed
hasFilesListFile()  : bool
Check if config/files.txt file exists
hasLocalUpdates()  : bool
Checks if file system version number matches module.yml data
hasMigrations()  : bool
Check if config/migrations/v*.php exists
hasUpdates()  : bool
Check if module has updates
install()  : bool
Install module
isActive()  : bool
Return active status
isInstallable()  : bool
Check if module is installed
isInstalled()  : bool
Return installed status
isWritable()  : bool
Check if module base folder and module.yml file are writable
prepareSaveOptions()  : bool
Prepares module config options before saving
removeDataFolder()  : bool
Delete module data path
setActive()  : $this
Set active status
setInstalled()  : $this
Set installed status
setOptions()  : bool
Updates module options
uninstall()  : bool
Uninstall module
update()  : bool
Update module
validateKey()  : bool
Validate module key
init()  : bool
Initialize module object
initObjects()  : bool
Initialize objects
createTable()  : bool
Create module config
getAllConfigOptions()  : array<string|int, mixed>
Fetch module system config options
getConfigPathFromCurrent()  : string
Return path for "config/" folder in current module base path
getTableFiles()  : array<string|int, mixed>
Return list of table files from module
getYaTdlObject()  : bool|yatdl
Fetch \fpcm\model\system\yatdl object
installConfig()  : bool
Create module config options
installTables()  : bool
Create module tables
installUpdateCronjobs()  : bool
Create module config options
removeConfig()  : bool
Remove module config
removeCronjobs()  : bool
Create module config options
removeFiles()  : bool
Remove module files
removeFullPrefix()  : string
Remove module prefix
removeModule()  : bool
Remove module database entry
removeTables()  : bool
Remove module tables
runMigrations()  : bool
Executes module-defined migrations on update
updateConfig()  : bool
Update module config
updateModule()  : bool|int
Update module databse entry
updateTables()  : bool
Update module tables

Constants

STATUS_DISABLED

public mixed STATUS_DISABLED = 1005

STATUS_ENABLED

public mixed STATUS_ENABLED = 1004

STATUS_INSTALLED

public mixed STATUS_INSTALLED = 1001

STATUS_NOT_DISABLED

public mixed STATUS_NOT_DISABLED = -1005

STATUS_NOT_ENABLED

public mixed STATUS_NOT_ENABLED = -1004

STATUS_NOT_INSTALLED

public mixed STATUS_NOT_INSTALLED = -1001

STATUS_NOT_UNINSTALLED

public mixed STATUS_NOT_UNINSTALLED = -1002

STATUS_UNINSTALLED

public mixed STATUS_UNINSTALLED = 1002

Properties

$active

Module active status

protected bool $active = 0

$basePath

Module base path

protected string $basePath = ''
Tags
since
4.3

$id

Dataset id

protected int $id = 0

$initDb

Initialize object from database

protected bool $initDb

$installed

Module installed status

protected bool $installed = 0

$mkey

Module key

protected string $mkey = ''

$prefix

Module prefix VENDOR_KEY

protected string $prefix = ''

$systemConfig

System config object

protected config $systemConfig

Methods

__construct()

Konstruktor

public final __construct(string $key[, bool $initDb = true ]) : bool
Parameters
$key : string
$initDb : bool = true
Return values
bool

addModule()

Add module entry to database

public addModule([bool $fromDir = false ]) : bool
Parameters
$fromDir : bool = false
Return values
bool

createDataFolder()

Create module data path

public final createDataFolder() : bool
Tags
version
5.0.0-b1
Return values
bool

createFromDbObject()

Initialize object with database data

public createFromDbObject(object $result) : bool
Parameters
$result : object
Return values
bool

disable()

Disable module

public disable() : bool
Return values
bool

enable()

Enable module

public enable() : bool
Return values
bool

fromPath()

public final fromPath() : paths
Tags
since
5.0.0-b1
Return values
paths

getConfigByKey()

Get config file path

public static getConfigByKey(string $key, string $config) : string
Parameters
$key : string
$config : string
Return values
string

getConfigureFields()

Fetch module configuration config from configure.yml

public getConfigureFields() : array<string|int, mixed>
Tags
since
4.5
Return values
array<string|int, mixed>

getConfigViewVars()

Return additional vars for configure view

public getConfigViewVars() : array<string|int, mixed>
Return values
array<string|int, mixed>

getControllerNamespace()

Get module controller class name

public static getControllerNamespace(string $key, string $event) : string
Parameters
$key : string
$event : string
Return values
string

getCronNamespace()

Return Namespace of module cronjobs

public static getCronNamespace(string $key, string $cron) : string
Parameters
$key : string
$cron : string
Tags
since
4.3
Return values
string

getDataPath()

Get module data path

public final getDataPath() : string
Tags
version
5.0.0-b1
Return values
string

getEventNamespace()

Get module event class name

public static getEventNamespace(string $key, string $event) : string
Parameters
$key : string
$event : string
Return values
string

getFullPrefix()

Fetch complete module prefix

public getFullPrefix([string $key = '' ]) : string
Parameters
$key : string = ''
Return values
string

getId()

Fetch dataset ID

public final getId() : int
Return values
int

getJsDirByKey()

Get JS file path

public static getJsDirByKey(string $key, string $filePath) : string
Parameters
$key : string
$filePath : string
Tags
since
4.4
Return values
string

getKey()

Return module key

public getKey() : string
Return values
string

getKeyFromClass()

fetch module key from class name

public static getKeyFromClass(string $class) : string
Parameters
$class : string
Return values
string

getKeyFromFilename()

fetch module key from filename

public static getKeyFromFilename(string $filename) : string
Parameters
$filename : string
Return values
string

getKeyFromPath()

fetch module key from filepath

public static getKeyFromPath(string $path) : string
Parameters
$path : string
Return values
string

getLanguageFileByKey()

Get language file path

public static getLanguageFileByKey(string $key, string $langKey) : string
Parameters
$key : string
$langKey : string
Return values
string

getLanguageVarPrefixed()

Assign module language variable prefix

public static getLanguageVarPrefixed(string $key) : string
Parameters
$key : string
Return values
string

getMigrationNamespace()

Return Namespace of module migrations

public static getMigrationNamespace(string $key, string $migration) : string
Parameters
$key : string
$migration : string
Tags
since
4.5.0-rc3
Return values
string

getMigrations()

Returns list of migrations

public final getMigrations() : array<string|int, mixed>
Tags
since
4.5.0-rc3
Return values
array<string|int, mixed>

getModuleBasePathFromKey()

Get base path from module

public static getModuleBasePathFromKey(string $key) : string
Parameters
$key : string
Tags
since
4.4
Return values
string

getModuleUrlFromKey()

Returns root URL for module path

public static getModuleUrlFromKey(string $key) : string
Parameters
$key : string
Tags
since
4.4
Return values
string

getOption()

Fetch system config options

public final getOption(string $key) : mixed
Parameters
$key : string
Return values
mixed

getOptions()

Fetch system config options

public final getOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>

getStyleDirByKey()

Get CSS file path

public static getStyleDirByKey(string $key, string $filePath) : string
Parameters
$key : string
$filePath : string
Tags
since
4.4
Return values
string

getTemplateDirByKey()

Get template file path

public static getTemplateDirByKey(string $key, string $viewName) : string
Parameters
$key : string
$viewName : string
Return values
string

hasConfigure()

Check if configure action should be displayed

public hasConfigure() : bool
Return values
bool

hasFilesListFile()

Check if config/files.txt file exists

public final hasFilesListFile() : bool
Tags
since
4.1
Return values
bool

hasLocalUpdates()

Checks if file system version number matches module.yml data

public hasLocalUpdates() : bool
Tags
since
4.1
Return values
bool

hasMigrations()

Check if config/migrations/v*.php exists

public final hasMigrations() : bool
Tags
since
4.5.0-rc3
Return values
bool

hasUpdates()

Check if module has updates

public hasUpdates() : bool
Return values
bool

install()

Install module

public final install([bool $fromDir = false ]) : bool
Parameters
$fromDir : bool = false
Return values
bool

isActive()

Return active status

public final isActive() : bool
Return values
bool

isInstallable()

Check if module is installed

public isInstallable() : bool
Return values
bool

isInstalled()

Return installed status

public final isInstalled() : bool
Return values
bool

isWritable()

Check if module base folder and module.yml file are writable

public isWritable() : bool
Tags
since
4.3
Return values
bool

prepareSaveOptions()

Prepares module config options before saving

public prepareSaveOptions(array<string|int, mixed> &$options) : bool
Parameters
$options : array<string|int, mixed>
Return values
bool

removeDataFolder()

Delete module data path

public final removeDataFolder() : bool
Tags
version
5.0.0-b1
Return values
bool

setActive()

Set active status

public final setActive(bool $active) : $this
Parameters
$active : bool
Return values
$this

setInstalled()

Set installed status

public final setInstalled(bool $installed) : $this
Parameters
$installed : bool
Return values
$this

setOptions()

Updates module options

public final setOptions(array<string|int, mixed> $options) : bool
Parameters
$options : array<string|int, mixed>
Return values
bool

uninstall()

Uninstall module

public final uninstall([bool $delete = false ][, bool $keepFiles = false ]) : bool
Parameters
$delete : bool = false
$keepFiles : bool = false
Return values
bool

update()

Update module

public final update() : bool
Return values
bool

validateKey()

Validate module key

public static validateKey(string $key) : bool
Parameters
$key : string
Tags
since
4.4
Return values
bool

init()

Initialize module object

protected init() : bool
Return values
bool

initObjects()

Initialize objects

protected initObjects() : bool
Return values
bool

createTable()

Create module config

private createTable(yatdl $tab) : bool
Parameters
$tab : yatdl
Return values
bool

getAllConfigOptions()

Fetch module system config options

private getAllConfigOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>

getConfigPathFromCurrent()

Return path for "config/" folder in current module base path

private getConfigPathFromCurrent(string $dest) : string
Parameters
$dest : string
Tags
since
4.5-rc3
Return values
string

getTableFiles()

Return list of table files from module

private getTableFiles() : array<string|int, mixed>
Return values
array<string|int, mixed>

getYaTdlObject()

Fetch \fpcm\model\system\yatdl object

private getYaTdlObject(string $tableFile) : bool|yatdl
Parameters
$tableFile : string
Return values
bool|yatdl

installConfig()

Create module config options

private installConfig() : bool
Return values
bool

installTables()

Create module tables

private installTables() : bool
Return values
bool

installUpdateCronjobs()

Create module config options

private installUpdateCronjobs() : bool
Return values
bool

removeConfig()

Remove module config

private removeConfig() : bool
Return values
bool

removeCronjobs()

Create module config options

private removeCronjobs() : bool
Return values
bool

removeFiles()

Remove module files

private removeFiles() : bool
Return values
bool

removeFullPrefix()

Remove module prefix

private removeFullPrefix([string $key = '' ]) : string
Parameters
$key : string = ''
Return values
string

removeModule()

Remove module database entry

private removeModule() : bool
Return values
bool

removeTables()

Remove module tables

private removeTables() : bool
Return values
bool

runMigrations()

Executes module-defined migrations on update

private runMigrations() : bool
Tags
since
4.5.1-b1
Return values
bool

updateConfig()

Update module config

private updateConfig() : bool
Return values
bool

updateModule()

Update module databse entry

private updateModule() : bool|int
Return values
bool|int

updateTables()

Update module tables

private updateTables() : bool
Return values
bool

Search results