module
in
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
= ""
$config
Module configuration
protected
config
$config
$systemConfig
System config object
protected
config
$systemConfig
$db
Databse object
protected
database
$db
$cache
Cache object
protected
cache
$cache
$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
boolgetId()
Fetch dataset ID
public
final getId(
)
: int
Return values
intgetKey()
Return module key
public
getKey(
)
: string
Return values
stringisInstalled()
Return installed status
public
final isInstalled(
)
: bool
Return values
boolisActive()
Return active status
public
final isActive(
)
: bool
Return values
boolsetInstalled()
Set installed status
public
final setInstalled(
$installed :
bool
)
: $this
Parameters
- $installed : bool
Return values
$thissetActive()
Set active status
public
final setActive(
$active :
bool
)
: $this
Parameters
- $active : bool
Return values
$thisinitObjects()
Initialize objects
protected
initObjects(
)
: bool
Return values
boolprepareSaveOptions()
Prepares module config options before saving
public
prepareSaveOptions(
&$options :
array
)
: bool
Parameters
- $options : array
Return values
boolgetOption()
Fetch system config options
public
final getOption(
$key :
string
)
: mixed
Parameters
- $key : string
Return values
mixedgetOptions()
Fetch system config options
public
final getOptions(
)
: array
Return values
arraygetConfigViewVars()
Return additional vars for configure view
public
getConfigViewVars(
)
: array
Return values
arraysetOptions()
Updates module options
public
final setOptions(
$options :
array
)
: array
Parameters
- $options : array
Return values
arraygetConfig()
Fetch module config
public
getConfig(
)
: config
Return values
configcreateFromDbObject()
Initialize object with database data
public
createFromDbObject(
$result :
object
)
: bool
Parameters
- $result : object
Return values
boolenable()
Enable module
public
enable(
)
: bool
Return values
booldisable()
Disable module
public
disable(
)
: bool
Return values
boolisWritable()
Check if module base folder and module.yml file are writable
public
isWritable(
)
: bool
Tags
Return values
boolisInstallable()
Check if module is installed
public
isInstallable(
)
: bool
Return values
boolhasUpdates()
Check if module has updates
public
hasUpdates(
)
: bool
Return values
boolhasLocalUpdates()
Checks if file system version number matches module.yml data
public
hasLocalUpdates(
)
: bool
Tags
Return values
boolhasConfigure()
Check if configure action should be displayed
public
hasConfigure(
&$legacy :
int
)
: bool
Parameters
- $legacy : int
Return values
boolgetConfigureFields()
Fetch module configuration config from configure.yml
public
getConfigureFields(
)
: array
Tags
Return values
arrayhasFilesListFile()
Check if config/files.txt file exists
public
final hasFilesListFile(
)
: bool
Tags
Return values
boolinit()
Initialize module object
protected
init(
)
: bool
Return values
boolgetFullPrefix()
Fetch complete module prefix
public
getFullPrefix(
[ $key :
string
= '' ]
)
: string
Parameters
- $key : string = ''
Return values
stringremoveFullPrefix()
Remove module prefix
private
removeFullPrefix(
[ $key :
string
= '' ]
)
: string
Parameters
- $key : string = ''
Return values
stringgetYaTdlObject()
Fetch \fpcm\model\system\yatdl object
private
getYaTdlObject(
$tableFile :
string
)
: bool|yatdl
Parameters
- $tableFile : string
Return values
bool|yatdlgetTableFiles()
Return list of table files from module
private
getTableFiles(
)
: array
Return values
arraygetAllConfigOptions()
Fetch module system config options
private
getAllConfigOptions(
)
: array
Return values
arraycreateTable()
Create module config
private
createTable(
$tab :
yatdl
)
: bool
Parameters
- $tab : yatdl
Return values
boolinstall()
Install module
public
final install(
[ $fromDir :
bool
= false ]
)
: bool
Parameters
- $fromDir : bool = false
Return values
booladdModule()
Add module entry to database
public
addModule(
[ $fromDir :
bool
= false ]
)
: bool
Parameters
- $fromDir : bool = false
Return values
boolinstallTables()
Create module tables
private
installTables(
)
: bool
Return values
boolinstallConfig()
Create module config options
private
installConfig(
)
: bool
Return values
boolinstallUpdateCronjobs()
Create module config options
private
installUpdateCronjobs(
)
: bool
Return values
booluninstall()
Uninstall module
public
final uninstall(
[ $delete :
bool
= false ]
[, $keepFiles :
bool
= false ]
)
: bool
Parameters
- $delete : bool = false
- $keepFiles : bool = false
Return values
boolremoveModule()
Remove module database entry
private
removeModule(
)
: bool
Return values
boolremoveFiles()
Remove module files
private
removeFiles(
)
: bool
Return values
boolremoveTables()
Remove module tables
private
removeTables(
)
: bool
Return values
boolremoveConfig()
Remove module config
private
removeConfig(
)
: bool
Return values
boolremoveCronjobs()
Create module config options
private
removeCronjobs(
)
: bool
Return values
boolupdate()
Update module
public
final update(
)
: bool
Return values
boolupdateModule()
Update module databse entry
private
updateModule(
)
: bool|int
Return values
bool|intupdateTables()
Update module tables
private
updateTables(
)
: bool
Return values
boolupdateConfig()
Update module config
private
updateConfig(
)
: bool
Return values
boolgetKeyFromPath()
fetch module key from filepath
public
static getKeyFromPath(
$path :
string
)
: string
Parameters
- $path : string
Return values
stringgetKeyFromFilename()
fetch module key from filename
public
static getKeyFromFilename(
$filename :
string
)
: string
Parameters
- $filename : string
Return values
stringgetKeyFromClass()
fetch module key from class name
public
static getKeyFromClass(
$class :
string
)
: string
Parameters
- $class : string
Return values
stringgetEventNamespace()
Get module event class name
public
static getEventNamespace(
$key :
string
, $event :
string
)
: string
Parameters
- $key : string
- $event : string
Return values
stringgetControllerNamespace()
Get module controller class name
public
static getControllerNamespace(
$key :
string
, $event :
string
)
: string
Parameters
- $key : string
- $event : string
Return values
stringgetCronNamespace()
Return Namespace of module cronjobs
public
static getCronNamespace(
$key :
string
, $cron :
string
)
: string
Parameters
- $key : string
- $cron : string
Tags
Return values
stringgetConfigByKey()
Get config file path
public
static getConfigByKey(
$key :
string
, $config :
string
)
: string
Parameters
- $key : string
- $config : string
Return values
stringgetTemplateDirByKey()
Get template file path
public
static getTemplateDirByKey(
$key :
string
, $viewName :
string
)
: string
Parameters
- $key : string
- $viewName : string
Return values
stringgetJsDirByKey()
Get JS file path
public
static getJsDirByKey(
$key :
string
, $filePath :
string
)
: string
Parameters
- $key : string
- $filePath : string
Tags
Return values
stringgetStyleDirByKey()
Get CSS file path
public
static getStyleDirByKey(
$key :
string
, $filePath :
string
)
: string
Parameters
- $key : string
- $filePath : string
Tags
Return values
stringgetLanguageFileByKey()
Get language file path
public
static getLanguageFileByKey(
$key :
string
, $langKey :
string
)
: string
Parameters
- $key : string
- $langKey : string
Return values
stringgetModuleBasePathFromKey()
Get base path from module
public
static getModuleBasePathFromKey(
$key :
string
)
: string
Parameters
- $key : string
Tags
Return values
stringgetModuleUrlFromKey()
Returns root URL for module path
public
static getModuleUrlFromKey(
$key :
string
)
: string
Parameters
- $key : string
Tags
Return values
stringgetLanguageVarPrefixed()
Assign module language variable prefix
public
static getLanguageVarPrefixed(
$key :
string
)
: string
Parameters
- $key : string
Return values
stringvalidateKey()
Validate module key
public
static validateKey(
$key :
string
)
: bool
Parameters
- $key : string