|
ILIAS
trunk Revision v13.0_alpha-62-g3b72d83f2e5
|
Reads the raw parameters of an activity strictly, with the Refinery. More...
Collaboration diagram for ILIAS\FileUpload\Activities\Parameter:Public Member Functions | |
| __construct (private readonly Refinery $refinery,) | |
| id (array $raw_parameters, string $name, string $missing) | |
| A positive whole number, e.g. More... | |
| string (array $raw_parameters, string $name) | |
| A plain value as it was sent, trimmed; null if it was not sent. More... | |
| text (array $raw_parameters, string $name) | |
| Text a user wrote, e.g. More... | |
| flag (array $raw_parameters, string $name, bool $default) | |
A yes or a no: true, false, 1, 0, also as text. More... | |
| list (array $raw_parameters, string $name) | |
| A list of plain values, sent as a list or comma separated; empty entries are dropped. More... | |
Private Member Functions | |
| toString () | |
| Text, or a number sent as one - a JSON body may well carry a title 42. More... | |
| trim () | |
| apply (Transformation $transformation, mixed $value, string $refusal) | |
| The Refinery says why in its own words and in its own exceptions; the caller is told which parameter was wrong, as a 400. More... | |
Reads the raw parameters of an activity strictly, with the Refinery.
Raw parameters come from outside - a query string, a JSON body - and a cast makes something of everything: ‘(int) ['5’]is 1, the root of the repository,(int) '102abc'is 102.kindlyTo()` is the right tool for values that arrive as text, but it is kind to more than text: it makes 1 of true and rounds 1.7. So every parameter first has to be of a type that can carry it (to()), and only then is it converted (kindlyTo()). A value that is not what the parameter takes is refused with a 400, so a client never gets an answer to a question it did not ask.
Once maybePerformAs() reads raw parameters through the input description of an activity, this goes away.
Definition at line 41 of file Parameter.php.
| ILIAS\FileUpload\Activities\Parameter::__construct | ( | private readonly Refinery | $refinery | ) |
Definition at line 43 of file Parameter.php.
|
private |
The Refinery says why in its own words and in its own exceptions; the caller is told which parameter was wrong, as a 400.
Definition at line 202 of file Parameter.php.
References Vendor\Package\$e, and ILIAS\Refinery\Transformation\transform().
Referenced by ILIAS\FileUpload\Activities\Parameter\flag(), ILIAS\FileUpload\Activities\Parameter\id(), ILIAS\FileUpload\Activities\Parameter\list(), ILIAS\FileUpload\Activities\Parameter\string(), and ILIAS\FileUpload\Activities\Parameter\text().
Here is the call graph for this function:
Here is the caller graph for this function:| ILIAS\FileUpload\Activities\Parameter::flag | ( | array | $raw_parameters, |
| string | $name, | ||
| bool | $default | ||
| ) |
A yes or a no: true, false, 1, 0, also as text.
Anything else is refused rather than read as "no" - for keep_previous_version a typo would be "drop the history". Only a missing value falls back to the default.
| array<string,mixed> | $raw_parameters |
Definition at line 125 of file Parameter.php.
References ILIAS\FileUpload\Activities\Parameter\apply(), and ILIAS\Repository\refinery().
Here is the call graph for this function:A positive whole number, e.g.
a reference id.
| array<string,mixed> | $raw_parameters | |
| string | $missing | what to answer when the parameter is not there |
Definition at line 54 of file Parameter.php.
References ILIAS\FileUpload\Activities\Parameter\apply(), and ILIAS\Repository\refinery().
Here is the call graph for this function:| ILIAS\FileUpload\Activities\Parameter::list | ( | array | $raw_parameters, |
| string | $name | ||
| ) |
A list of plain values, sent as a list or comma separated; empty entries are dropped.
| array<string,mixed> | $raw_parameters |
Definition at line 148 of file Parameter.php.
References ILIAS\FileUpload\Activities\Parameter\apply(), and ILIAS\Repository\refinery().
Here is the call graph for this function:| ILIAS\FileUpload\Activities\Parameter::string | ( | array | $raw_parameters, |
| string | $name | ||
| ) |
A plain value as it was sent, trimmed; null if it was not sent.
| array<string,mixed> | $raw_parameters |
Definition at line 81 of file Parameter.php.
References ILIAS\FileUpload\Activities\Parameter\apply(), and ILIAS\FileUpload\Activities\Parameter\toString().
Here is the call graph for this function:| ILIAS\FileUpload\Activities\Parameter::text | ( | array | $raw_parameters, |
| string | $name | ||
| ) |
Text a user wrote, e.g.
a title: tags are stripped, as the fields of the UI framework do. Null if it was not sent.
| array<string,mixed> | $raw_parameters |
Definition at line 98 of file Parameter.php.
References ILIAS\FileUpload\Activities\Parameter\apply(), and ILIAS\Repository\refinery().
Here is the call graph for this function:
|
private |
Text, or a number sent as one - a JSON body may well carry a title 42.
Definition at line 178 of file Parameter.php.
References ILIAS\Repository\refinery().
Referenced by ILIAS\FileUpload\Activities\Parameter\string().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 191 of file Parameter.php.
References ILIAS\Repository\refinery(), and ILIAS\FileUpload\Activities\Parameter\trim().
Referenced by ILIAS\FileUpload\Activities\Parameter\trim().
Here is the call graph for this function:
Here is the caller graph for this function: