ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
Activity.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
26 use ILIAS\Data\Text;
28 
38 interface Activity
39 {
43  public function getName(): Name;
44 
45  public function getType(): ActivityType;
46 
48 
49  public function getInputDescription(): FormInput; // might better be ILIAS/UI/Input/Input, but we would need to promote many properties there before.
50 
51  public function getOutputDescription(Description\Factory $f): Description\Description;
52 
62  public function isAllowedToPerform(int $usr_id, mixed $parameters): bool;
63 
72  public function perform(mixed $parameters): mixed;
73 
79  public function maybePerformAs(int $usr_id, array $raw_parameters): Result;
80 }
getOutputDescription(Description\Factory $f)
maybePerformAs(int $usr_id, array $raw_parameters)
Grinds the $raw_parameters through the input description, checks if the users is allowed to perform t...
isAllowedToPerform(int $usr_id, mixed $parameters)
This shall check if the given user is allowed to perform the activity based on business rules of this...
An Activity is an action on the domain layer action of a component.
Definition: Activity.php:38
getName()
Shall return classname of the Activity, wrapped in Name.
This describes some datastructure in terms of standard data structures such as primitives, lists, maps and objects and helpful (hopefully...) human readable texts.
Definition: Description.php:32
perform(mixed $parameters)
This shall perform the activity.