|
| __construct (Manager $amcManager, UserIdentity $userIdentity, UserOptionsLookup $userOptionsLookup, UserOptionsManager $userOptionsManager) |
|
| getModeIdentifier () |
|
| isEnabled () |
| Return information if the AMC mode is enabled by user.
|
|
| setEnabled (bool $isEnabled) |
| Set Advanced Mobile Contributions mode to enabled or disabled.
|
|
|
static | newForUser (UserIdentity $userIdentity) |
| Create UserMode for given user NamedConstructor used by hooks system.
|
|
|
const | USER_OPTION_MODE_AMC = 'mf_amc_optin' |
|
const | OPTION_ENABLED = '1' |
| Value in the user options when AMC is enabled.
|
|
const | OPTION_DISABLED = '0' |
| Value in the user options when AMC is disabled (default state)
|
|
◆ __construct()
MobileFrontend\Amc\UserMode::__construct |
( |
Manager | $amcManager, |
|
|
UserIdentity | $userIdentity, |
|
|
UserOptionsLookup | $userOptionsLookup, |
|
|
UserOptionsManager | $userOptionsManager ) |
- Parameters
-
Manager | $amcManager | |
UserIdentity | $userIdentity | |
UserOptionsLookup | $userOptionsLookup | |
UserOptionsManager | $userOptionsManager | |
- Exceptions
-
RuntimeException When AMC mode is not available
◆ getModeIdentifier()
MobileFrontend\Amc\UserMode::getModeIdentifier |
( |
| ) |
|
◆ isEnabled()
MobileFrontend\Amc\UserMode::isEnabled |
( |
| ) |
|
◆ newForUser()
static MobileFrontend\Amc\UserMode::newForUser |
( |
UserIdentity | $userIdentity | ) |
|
|
static |
Create UserMode for given user NamedConstructor used by hooks system.
- Parameters
-
UserIdentity | $userIdentity | |
- Returns
- self
◆ setEnabled()
MobileFrontend\Amc\UserMode::setEnabled |
( |
bool | $isEnabled | ) |
|
Set Advanced Mobile Contributions mode to enabled or disabled.
WARNING: Does not persist the updated user preference to the database. The caller must handle this by calling User::saveSettings() after all preference updates associated with this web request are made.
- Parameters
-
- Exceptions
-
RuntimeException | when mode is disabled |
Implements MobileFrontend\Features\IUserSelectableMode.
The documentation for this class was generated from the following file:
- includes/Amc/UserMode.php