Class humhub\modules\content\components\ContentContainerModuleManager

Inheritancehumhub\modules\content\components\ContentContainerModuleManager » yii\base\Component
Available since version1.3

ModuleManager handles modules of a content container.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
canDisable() Checks whether the module can be disabled or not humhub\modules\content\components\ContentContainerModuleManager
canEnable() Checks whether the module can be enabled or not humhub\modules\content\components\ContentContainerModuleManager
disable() Disables a module for the content container humhub\modules\content\components\ContentContainerModuleManager
enable() Enables a module for this content container humhub\modules\content\components\ContentContainerModuleManager
flushCache() Flushes the cache of available modules. humhub\modules\content\components\ContentContainerModuleManager
getAvailable() Returns an array of all available modules humhub\modules\content\components\ContentContainerModuleManager
getContentContainerQueryByModule() Returns a query for \humhub\modules\content\models\ContentContainer where the given module is enabled. humhub\modules\content\components\ContentContainerModuleManager
getDefaultState() Returns the default module state for a given contentcontainer class humhub\modules\content\components\ContentContainerModuleManager
getEnabled() Returns an array of all enabled module ids humhub\modules\content\components\ContentContainerModuleManager
isEnabled() Checks whether the module is activated or not humhub\modules\content\components\ContentContainerModuleManager
setDefaultState() Sets the default state for a module based on the contentcontainer class humhub\modules\content\components\ContentContainerModuleManager

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
getModuleStateRecord() Returns an Module record instance for the given module id humhub\modules\content\components\ContentContainerModuleManager
getStates() Returns an array of all module states. humhub\modules\content\components\ContentContainerModuleManager

Property Details

Method Details

canDisable() public method

Checks whether the module can be disabled or not

public boolean canDisable ( $id )
$id string

The module id

canEnable() public method

Checks whether the module can be enabled or not

public boolean canEnable ( $id )
$id string

The module id

disable() public method

Disables a module for the content container

public boolean disable ( $id )
$id string

The module id

throws \yii\base\Exception
enable() public method

Enables a module for this content container

public boolean enable ( $id )
$id string

The module id

throws \yii\base\Exception
flushCache() public method (available since version 1.3.11)

Flushes the cache of available modules.

public void flushCache ( )
getAvailable() public method

Returns an array of all available modules

public humhub\modules\content\components\ContentContainerModule[] getAvailable ( )
return humhub\modules\content\components\ContentContainerModule[]

A list of modules

throws \yii\base\Exception
getContentContainerQueryByModule() public static method

Returns a query for \humhub\modules\content\models\ContentContainer where the given module is enabled.

public static \yii\db\ActiveQuery getContentContainerQueryByModule ( $id )
$id string

The module mid

return \yii\db\ActiveQuery

The list of content container

getDefaultState() public static method

Returns the default module state for a given contentcontainer class

public static integer|null getDefaultState ( $class, $id )
$class string

The class name (e.g. Space or User)

$id string

The module id

return integer|null

The default state or null when no default state is defined

getEnabled() public method

Returns an array of all enabled module ids

public array getEnabled ( )
return array

A list of enabled module ids

getModuleStateRecord() protected method

Returns an Module record instance for the given module id

See also \humhub\modules\content\components\Module.

protected humhub\modules\content\models\ContentContainerModuleState getModuleStateRecord ( $id )
$id string

The module id

getStates() protected method

Returns an array of all module states.

See also \humhub\modules\content\components\Module.

protected array getStates ( )
return array

A list of modules with the corresponding state

isEnabled() public method

Checks whether the module is activated or not

public boolean isEnabled ( $id )
$id string

The module id

setDefaultState() public static method

Sets the default state for a module based on the contentcontainer class

public static void setDefaultState ( $class, $id, $state )
$class string

The class name (e.g. Space or User)

$id string

The module id

$state integer

The state