Controller for license compatibility rules.
More...
|
| | __construct ($container) |
| |
| | getRules ($request, $response, $args) |
| |
| | createRule ($request, $response, $args) |
| |
| | updateRule ($request, $response, $args) |
| |
| | deleteRule ($request, $response, $args) |
| |
| | exportRules ($request, $response, $args) |
| |
| | isJsonRequest ($request) |
| |
Controller for license compatibility rules.
Definition at line 33 of file LicenseCompatibilityRuleController.php.
◆ __construct()
| Fossology\UI\Api\Controllers\LicenseCompatibilityRuleController::__construct |
( |
|
$container | ) |
|
◆ createRule()
| Fossology\UI\Api\Controllers\LicenseCompatibilityRuleController::createRule |
( |
|
$request, |
|
|
|
$response, |
|
|
|
$args |
|
) |
| |
Create a new license compatibility rule
- Parameters
-
| Request | $request | |
| ResponseHelper | $response | |
| array | $args | |
- Returns
- ResponseHelper
- Exceptions
-
Definition at line 141 of file LicenseCompatibilityRuleController.php.
◆ deleteRule()
| Fossology\UI\Api\Controllers\LicenseCompatibilityRuleController::deleteRule |
( |
|
$request, |
|
|
|
$response, |
|
|
|
$args |
|
) |
| |
Delete an existing license compatibility rule
- Parameters
-
| Request | $request | |
| ResponseHelper | $response | |
| array | $args | |
- Returns
- ResponseHelper
- Exceptions
-
Definition at line 203 of file LicenseCompatibilityRuleController.php.
◆ exportRules()
| Fossology\UI\Api\Controllers\LicenseCompatibilityRuleController::exportRules |
( |
|
$request, |
|
|
|
$response, |
|
|
|
$args |
|
) |
| |
Export the license compatibility rules as a YAML file
- Parameters
-
| Request | $request | |
| ResponseHelper | $response | |
| array | $args | |
- Returns
- ResponseHelper
- Exceptions
-
Definition at line 259 of file LicenseCompatibilityRuleController.php.
◆ getLicenseTypes()
| Fossology\UI\Api\Controllers\LicenseCompatibilityRuleController::getLicenseTypes |
( |
| ) |
|
|
private |
◆ getRuleField()
| Fossology\UI\Api\Controllers\LicenseCompatibilityRuleController::getRuleField |
( |
|
$body, |
|
|
|
$nameV2, |
|
|
|
$nameV1 |
|
) |
| |
|
private |
Read a rule field from the request body.
Both the camelCase (version 2) and the snake_case (version 1) name of the field are accepted.
- Parameters
-
| array | $body | Parsed request body |
| string | $nameV2 | Name of the field in version 2 |
| string | $nameV1 | Name of the field in version 1 |
- Returns
- array Array with the presence of the field and its value
Definition at line 375 of file LicenseCompatibilityRuleController.php.
◆ getRules()
| Fossology\UI\Api\Controllers\LicenseCompatibilityRuleController::getRules |
( |
|
$request, |
|
|
|
$response, |
|
|
|
$args |
|
) |
| |
Get the list of license compatibility rules, paginated upon request params
- Parameters
-
| Request | $request | |
| ResponseHelper | $response | |
| array | $args | |
- Returns
- ResponseHelper
- Exceptions
-
Definition at line 76 of file LicenseCompatibilityRuleController.php.
◆ parseRule()
| Fossology\UI\Api\Controllers\LicenseCompatibilityRuleController::parseRule |
( |
|
$body, |
|
|
|
$isNewRule |
|
) |
| |
|
private |
Validate the rule values sent in the request body.
Only the fields present in the body are returned, which allows updating a rule partially. For a new rule, the description and the compatibility result are mandatory and at least one license or license type has to be given, otherwise the rule would shadow the default compatibility.
- Parameters
-
| array | null | $body | Parsed request body |
| boolean | $isNewRule | True while creating a rule |
- Returns
- array Rule values as expected by CompatibilityDao
- Exceptions
-
Definition at line 303 of file LicenseCompatibilityRuleController.php.
◆ updateRule()
| Fossology\UI\Api\Controllers\LicenseCompatibilityRuleController::updateRule |
( |
|
$request, |
|
|
|
$response, |
|
|
|
$args |
|
) |
| |
Update an existing license compatibility rule
- Parameters
-
| Request | $request | |
| ResponseHelper | $response | |
| array | $args | |
- Returns
- ResponseHelper
- Exceptions
-
Definition at line 167 of file LicenseCompatibilityRuleController.php.
◆ validateLicenseId()
| Fossology\UI\Api\Controllers\LicenseCompatibilityRuleController::validateLicenseId |
( |
|
$licenseId, |
|
|
|
$field |
|
) |
| |
|
private |
Validate a license ID sent in the request body.
- Parameters
-
| mixed | $licenseId | Value to validate, null matches every license |
| string | $field | Name of the field to report in the error message |
- Returns
- int|null Validated license ID
- Exceptions
-
Definition at line 393 of file LicenseCompatibilityRuleController.php.
◆ validateLicenseType()
| Fossology\UI\Api\Controllers\LicenseCompatibilityRuleController::validateLicenseType |
( |
|
$licenseType, |
|
|
|
$field |
|
) |
| |
|
private |
Validate a license type sent in the request body.
- Parameters
-
| mixed | $licenseType | Value to validate, null matches every type |
| string | $field | Name of the field to report in the error message |
- Returns
- string|null Validated license type
- Exceptions
-
Definition at line 416 of file LicenseCompatibilityRuleController.php.
◆ $compatibilityDao
| CompatibilityDao Fossology\UI\Api\Controllers\LicenseCompatibilityRuleController::$compatibilityDao |
|
private |
◆ LIMIT_PARAM
| const Fossology\UI\Api\Controllers\LicenseCompatibilityRuleController::LIMIT_PARAM = "limit" |
◆ PAGE_PARAM
| const Fossology\UI\Api\Controllers\LicenseCompatibilityRuleController::PAGE_PARAM = "page" |
◆ RULE_FETCH_LIMIT
| const Fossology\UI\Api\Controllers\LicenseCompatibilityRuleController::RULE_FETCH_LIMIT = 100 |
◆ SEARCH_PARAM
| const Fossology\UI\Api\Controllers\LicenseCompatibilityRuleController::SEARCH_PARAM = "search" |
The documentation for this class was generated from the following file: