|
const | CORE_LICENSE = 0 |
| License is a core license and can not be updated or deleted.
|
|
const | CUSTOM_LICENSE = 1 |
| License is a custom license and can be updated and/or deleted.
|
|
const | LICENSE_DISABLED = 0 |
| Integer representation of boolean for a license that is disabled.
|
|
const | LICENSE_ENABLED = 1 |
| Integer representation of boolean for a license that is enabled.
|
|
const | LICENSE_MOVE_DOWN = 1 |
| Integer for moving a license down order.
|
|
const | LICENSE_MOVE_UP = -1 |
| Integer for moving a license up order.
|
|
|
static | create ($license) |
| Create a license record. More...
|
|
static | set_active_licenses () |
| Store active licenses in global config.
|
|
static | update ($license) |
| Update a license record. More...
|
|
◆ add()
license_manager::add |
( |
|
$license | ) |
|
◆ change_license_sortorder()
static license_manager::change_license_sortorder |
( |
int |
$direction, |
|
|
string |
$licenseshortname |
|
) |
| |
|
static |
Change the sort order of a license (and it's sibling license as a result).
- Parameters
-
int | $direction | value to change sortorder of license by. |
string | $licenseshortname | the shortname of license to changes sortorder for. |
- Exceptions
-
◆ create()
static license_manager::create |
( |
|
$license | ) |
|
|
staticprotected |
Create a license record.
- Parameters
-
object | $license | the license to create record for. |
◆ delete()
static license_manager::delete |
( |
|
$licenseshortname | ) |
|
|
static |
Delete a custom license.
- Parameters
-
string | $licenseshortname | the shortname of license. |
- Exceptions
-
◆ disable()
static license_manager::disable |
( |
|
$license | ) |
|
|
static |
Disable a license.
- Parameters
-
string | $license | the shortname of license |
- Return values
-
◆ enable()
static license_manager::enable |
( |
|
$license | ) |
|
|
static |
Enable a license.
- Parameters
-
string | $license | the shortname of license |
- Return values
-
◆ get_active_licenses()
static license_manager::get_active_licenses |
( |
| ) |
|
|
static |
Get the globally configured active licenses.
- Return values
-
- Exceptions
-
◆ get_active_licenses_as_array()
static license_manager::get_active_licenses_as_array |
( |
| ) |
|
|
static |
Get the globally configured active licenses as an array.
- Return values
-
array::$licenses | an associative array of licenses shaped as ['shortname' => 'fullname'] |
◆ get_license_by_shortname()
static license_manager::get_license_by_shortname |
( |
string |
$name | ) |
|
|
static |
Get license record by shortname.
- Parameters
-
string | $name | the shortname of license |
- Return values
-
object|null | the license or null if no license found. |
◆ get_licenses()
static license_manager::get_licenses |
( |
| ) |
|
|
static |
Get license records.
- Return values
-
array|false | object[] of license records of false if none. |
◆ read()
static license_manager::read |
( |
array |
$params = [] | ) |
|
|
static |
Read licens record(s) from database.
- Parameters
-
array | $params | license parameters to return licenses for. |
- Return values
-
array::$filteredlicenses | object[] of licenses. |
◆ save()
static license_manager::save |
( |
|
$license | ) |
|
|
static |
Save a license record.
- Parameters
-
object | $license | { shortname => string a shortname of license, will be refered by files table[required] fullname => string the fullname of the license [required] source => string the homepage of the license type[required] enabled => int is it enabled? version => int a version number used by moodle [required] } |
◆ update()
static license_manager::update |
( |
|
$license | ) |
|
|
staticprotected |
Update a license record.
- Parameters
-
object | $license | the license to update record for. |
- Exceptions
-
The documentation for this class was generated from the following file: