Documentation

module

Module base model

Table of Contents

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

Constants

STATUS_INSTALLED

mixed $STATUS_INSTALLED = 1001

STATUS_UNINSTALLED

mixed $STATUS_UNINSTALLED = 1002

STATUS_ENABLED

mixed $STATUS_ENABLED = 1004

STATUS_DISABLED

mixed $STATUS_DISABLED = 1005

STATUS_NOT_INSTALLED

mixed $STATUS_NOT_INSTALLED = -1001

STATUS_NOT_UNINSTALLED

mixed $STATUS_NOT_UNINSTALLED = -1002

STATUS_NOT_ENABLED

mixed $STATUS_NOT_ENABLED = -1004

STATUS_NOT_DISABLED

mixed $STATUS_NOT_DISABLED = -1005

Properties

$id

Dataset id

protected int $id = ""

$mkey

Module key

protected string $mkey = ''

$prefix

Module prefix VENDOR_KEY

protected string $prefix = ''

$installed

Module installed status

protected bool $installed = ""

$active

Module active status

protected bool $active = ""

$systemConfig

System config object

protected config $systemConfig

$initDb

Initialize object from database

protected bool $initDb

$basePath

Module base path

protected string $basePath = ''

Methods

__construct()

Konstruktor

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

getId()

Fetch dataset ID

public final getId( ) : int
Return values
int

getKey()

Return module key

public getKey( ) : string
Return values
string

isInstalled()

Return installed status

public final isInstalled( ) : bool
Return values
bool

isActive()

Return active status

public final isActive( ) : bool
Return values
bool

setInstalled()

Set installed status

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

setActive()

Set active status

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

initObjects()

Initialize objects

protected initObjects( ) : bool
Return values
bool

prepareSaveOptions()

Prepares module config options before saving

public prepareSaveOptions( &$options : array ) : bool
Parameters
$options : array
Return values
bool

getOption()

Fetch system config options

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

getOptions()

Fetch system config options

public final getOptions( ) : array
Return values
array

getConfigViewVars()

Return additional vars for configure view

public getConfigViewVars( ) : array
Return values
array

setOptions()

Updates module options

public final setOptions( $options : array ) : array
Parameters
$options : array
Return values
array

createFromDbObject()

Initialize object with database data

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

enable()

Enable module

public enable( ) : bool
Return values
bool

disable()

Disable module

public disable( ) : bool
Return values
bool

isWritable()

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

public isWritable( ) : bool
Tags
since
Return values
bool

isInstallable()

Check if module is installed

public isInstallable( ) : bool
Return values
bool

hasUpdates()

Check if module has updates

public hasUpdates( ) : bool
Return values
bool

hasLocalUpdates()

Checks if file system version number matches module.yml data

public hasLocalUpdates( ) : bool
Tags
since
Return values
bool

hasConfigure()

Check if configure action should be displayed

public hasConfigure( &$legacy : int ) : bool
Parameters
$legacy : int
Return values
bool

getConfigureFields()

Fetch module configuration config from configure.yml

public getConfigureFields( ) : array
Tags
since
Return values
array

hasFilesListFile()

Check if config/files.txt file exists

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

init()

Initialize module object

protected init( ) : bool
Return values
bool

getFullPrefix()

Fetch complete module prefix

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

removeFullPrefix()

Remove module prefix

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

getYaTdlObject()

Fetch \fpcm\model\system\yatdl object

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

getTableFiles()

Return list of table files from module

private getTableFiles( ) : array
Return values
array

getAllConfigOptions()

Fetch module system config options

private getAllConfigOptions( ) : array
Return values
array

createTable()

Create module config

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

install()

Install module

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

addModule()

Add module entry to database

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

installTables()

Create module tables

private installTables( ) : bool
Return values
bool

installConfig()

Create module config options

private installConfig( ) : bool
Return values
bool

installUpdateCronjobs()

Create module config options

private installUpdateCronjobs( ) : bool
Return values
bool

uninstall()

Uninstall module

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

removeModule()

Remove module database entry

private removeModule( ) : bool
Return values
bool

removeFiles()

Remove module files

private removeFiles( ) : bool
Return values
bool

removeTables()

Remove module tables

private removeTables( ) : 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

update()

Update module

public final update( ) : 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

updateConfig()

Update module config

private updateConfig( ) : bool
Return values
bool

getKeyFromPath()

fetch module key from filepath

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

getKeyFromFilename()

fetch module key from filename

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

getKeyFromClass()

fetch module key from class name

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

getEventNamespace()

Get module event class name

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

getControllerNamespace()

Get module controller class name

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

getCronNamespace()

Return Namespace of module cronjobs

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

getConfigByKey()

Get config file path

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

getTemplateDirByKey()

Get template file path

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

getJsDirByKey()

Get JS file path

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

getStyleDirByKey()

Get CSS file path

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

getLanguageFileByKey()

Get language file path

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

getModuleBasePathFromKey()

Get base path from module

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

getModuleUrlFromKey()

Returns root URL for module path

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

getLanguageVarPrefixed()

Assign module language variable prefix

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

validateKey()

Validate module key

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

Search results