ILIAS  release_8 Revision v8.24
ilLSPostCondition Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilLSPostCondition:

Public Member Functions

 __construct (int $ref_id, string $operator, ?string $value=null)
 
 getRefId ()
 
 withRefId (int $ref_id)
 
 getConditionOperator ()
 
 withConditionOperator (string $operator)
 
 getValue ()
 
 withValue (string $value)
 

Protected Attributes

int $ref_id
 
string $operator
 
string $value
 

Static Protected Attributes

static $known_operators
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning A PostCondition does restrict the progression of a user through the learning sequence. Thus, instead of saying "You may only _visit_ this object if you did this", a PostCondition says "you may only _leave_ this object if you did this".

LSPostConditions are being applied by the LearningSequenceConditionController.

Definition at line 28 of file class.ilLSPostCondition.php.

Constructor & Destructor Documentation

◆ __construct()

ilLSPostCondition::__construct ( int  $ref_id,
string  $operator,
?string  $value = null 
)

Definition at line 43 of file class.ilLSPostCondition.php.

47 {
48 if (!in_array($operator, self::$known_operators)) {
49 throw new \InvalidArgumentException(
50 "Unknown operator: $operator"
51 );
52 }
53
54 $this->ref_id = $ref_id;
55 $this->operator = $operator;
56 $this->value = $value;
57 }

References $operator, $ref_id, and $value.

Member Function Documentation

◆ getConditionOperator()

ilLSPostCondition::getConditionOperator ( )

Definition at line 71 of file class.ilLSPostCondition.php.

71 : string
72 {
73 return $this->operator;
74 }

References $operator.

◆ getRefId()

ilLSPostCondition::getRefId ( )

Definition at line 59 of file class.ilLSPostCondition.php.

59 : int
60 {
61 return $this->ref_id;
62 }

References $ref_id.

Referenced by ilLSPostConditionDB\upsert().

+ Here is the caller graph for this function:

◆ getValue()

ilLSPostCondition::getValue ( )

Definition at line 89 of file class.ilLSPostCondition.php.

89 : ?string
90 {
91 return $this->value;
92 }

References $value.

◆ withConditionOperator()

ilLSPostCondition::withConditionOperator ( string  $operator)

Definition at line 76 of file class.ilLSPostCondition.php.

77 {
78 if (!in_array($operator, self::$known_operators)) {
79 throw new \InvalidArgumentException(
80 "Unknown operator: $operator"
81 );
82 }
83
84 $clone = clone $this;
85 $clone->operator = $operator;
86 return $clone;
87 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $operator.

◆ withRefId()

ilLSPostCondition::withRefId ( int  $ref_id)

Definition at line 64 of file class.ilLSPostCondition.php.

64 : self
65 {
66 $clone = clone $this;
67 $clone->ref_id = $ref_id;
68 return $clone;
69 }

References $ref_id.

◆ withValue()

ilLSPostCondition::withValue ( string  $value)

Definition at line 94 of file class.ilLSPostCondition.php.

95 {
96 $clone = clone $this;
97 $clone->value = $value;
98 return $clone;
99 }

References $value.

Field Documentation

◆ $known_operators

ilLSPostCondition::$known_operators
staticprotected
Initial value:
= [
"always",
"failed",
"finished",
"learning_progress",
"not_finished",
"passed"
]

Definition at line 30 of file class.ilLSPostCondition.php.

◆ $operator

string ilLSPostCondition::$operator
protected

◆ $ref_id

int ilLSPostCondition::$ref_id
protected

Definition at line 39 of file class.ilLSPostCondition.php.

Referenced by __construct(), getRefId(), and withRefId().

◆ $value

string ilLSPostCondition::$value
protected

Definition at line 41 of file class.ilLSPostCondition.php.

Referenced by __construct(), getValue(), and withValue().


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