ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ILIAS\Component\Activities\Activity Interface Reference

An Activity is an action on the domain layer action of a component. More...

+ Inheritance diagram for ILIAS\Component\Activities\Activity:
+ Collaboration diagram for ILIAS\Component\Activities\Activity:

Public Member Functions

 getName ()
 Shall return classname of the Activity, wrapped in Name. More...
 
 getType ()
 
 getDescription ()
 
 getInputDescription ()
 
 getOutputDescription (Description\Factory $f)
 
 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 component. More...
 
 perform (mixed $parameters)
 This shall perform the activity. More...
 
 maybePerformAs (int $usr_id, array $raw_parameters)
 Grinds the $raw_parameters through the input description, checks if the users is allowed to perform the action as requested and, if so, then attempts to performs it. More...
 

Detailed Description

An Activity is an action on the domain layer action of a component.

This defines the interface to any activity. When implementing Activities, you should use one of these base classes:

Definition at line 38 of file Activity.php.

Member Function Documentation

◆ getDescription()

ILIAS\Component\Activities\Activity::getDescription ( )

◆ getInputDescription()

ILIAS\Component\Activities\Activity::getInputDescription ( )

◆ getName()

ILIAS\Component\Activities\Activity::getName ( )

Shall return classname of the Activity, wrapped in Name.

Implemented in ILIAS\Component\Activities\ActivityImpl.

◆ getOutputDescription()

ILIAS\Component\Activities\Activity::getOutputDescription ( Description\Factory  $f)

◆ getType()

ILIAS\Component\Activities\Activity::getType ( )

◆ isAllowedToPerform()

ILIAS\Component\Activities\Activity::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 component.

This shall, for example, check if the given user may add this other user to a course based on RBAC and position permissions, but this shall not check overall business rules such as: root may do everything. This shall not cause any observable side effects.

Parameters
mixed$parameterswhatever the FormInput from getInputDescription produces.

Implemented in ILIAS\Setup\Activities\GetStatus.

◆ maybePerformAs()

ILIAS\Component\Activities\Activity::maybePerformAs ( int  $usr_id,
array  $raw_parameters 
)

Grinds the $raw_parameters through the input description, checks if the users is allowed to perform the action as requested and, if so, then attempts to performs it.

Wraps the result and possible errors in the Result type.

Implemented in ILIAS\Setup\Activities\GetStatus.

◆ perform()

ILIAS\Component\Activities\Activity::perform ( mixed  $parameters)

This shall perform the activity.

This shall not check if a user is allowed to perform the activity. The returned data should match the Description given by getOutputDescription.

Exceptions
anySPL Exception (https://www.php.net/manual/en/spl.exceptions.php)
Parameters
mixed$parameterswhatever the FormInput from getInputDescription produces.

Implemented in ILIAS\Setup\Activities\GetStatus.


The documentation for this interface was generated from the following file: