ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\LegalDocuments\StartUpStep Class Reference
+ Inheritance diagram for ILIAS\LegalDocuments\StartUpStep:
+ Collaboration diagram for ILIAS\LegalDocuments\StartUpStep:

Public Member Functions

 __construct (private readonly ilCtrl $ctrl, Conductor $legal_documents)
 
 shouldStoreRequestTarget ()
 
 shouldInterceptRequest ()
 
 execute ()
 
 isInFulfillment ()
 
 shouldStoreRequestTarget ()
 
 shouldInterceptRequest ()
 
 isInFulfillment ()
 
 execute ()
 

Private Member Functions

 allInterceptingPaths ()
 
 findCurrent ()
 
 find (Closure $predicate, array $array)
 @template A More...
 

Private Attributes

readonly array $all
 
readonly Intercept $current
 

Detailed Description

Definition at line 32 of file StartUpStep.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\LegalDocuments\StartUpStep::__construct ( private readonly ilCtrl  $ctrl,
Conductor  $legal_documents 
)

Definition at line 38 of file StartUpStep.php.

39 {
40 $this->all = $legal_documents->intercepting();
41 $this->current = new LazyIntercept($this->findCurrent(...));
42 }

References ILIAS\LegalDocuments\StartUpStep\findCurrent(), and ILIAS\LegalDocuments\Conductor\intercepting().

+ Here is the call graph for this function:

Member Function Documentation

◆ allInterceptingPaths()

ILIAS\LegalDocuments\StartUpStep::allInterceptingPaths ( )
private
Returns
list<string>

Definition at line 73 of file StartUpStep.php.

73 : array
74 {
75 return array_map(
76 fn($intercept) => strtolower($intercept->target()->guiName()),
77 array_filter($this->all, fn($i) => $i->intercept())
78 );
79 }

◆ execute()

ILIAS\LegalDocuments\StartUpStep::execute ( )
Returns
void

Reimplemented from ILIAS\Init\StartupSequence\StartUpSequenceStep.

Definition at line 54 of file StartUpStep.php.

54 : void
55 {
56 $target = $this->current->target();
57 $this->ctrl->setParameterByClass($target->guiName(), 'id', $this->current->id());
58 $this->ctrl->redirectToURL($this->ctrl->getLinkTargetByClass($target->guiPath(), $target->command()));
59 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ find()

ILIAS\LegalDocuments\StartUpStep::find ( Closure  $predicate,
array  $array 
)
private

@template A

Parameters
Closure(A)bool $predicate
A[]$array
Returns
Result

Definition at line 98 of file StartUpStep.php.

98 : Result
99 {
100 foreach ($array as $x) {
101 if ($predicate($x)) {
102 return new Ok($x);
103 }
104 }
105 return new Error('Not found.');
106 }

Referenced by ILIAS\LegalDocuments\StartUpStep\findCurrent().

+ Here is the caller graph for this function:

◆ findCurrent()

ILIAS\LegalDocuments\StartUpStep::findCurrent ( )
private

Definition at line 81 of file StartUpStep.php.

81 : Intercept
82 {
83 return $this->find(
84 fn($x) => $x->intercept(),
85 $this->all
86 )->except(
87 fn() => new Ok(new NullIntercept())
88 )->value();
89 }
find(Closure $predicate, array $array)
@template A
Definition: StartUpStep.php:98

References ILIAS\LegalDocuments\StartUpStep\find().

Referenced by ILIAS\LegalDocuments\StartUpStep\__construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isInFulfillment()

ILIAS\LegalDocuments\StartUpStep::isInFulfillment ( )
Returns
bool

Reimplemented from ILIAS\Init\StartupSequence\StartUpSequenceStep.

Definition at line 61 of file StartUpStep.php.

61 : bool
62 {
63 return in_array(
64 strtolower($this->ctrl->getCmdClass() ?? ''),
65 $this->allInterceptingPaths(),
66 true
67 );
68 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ shouldInterceptRequest()

ILIAS\LegalDocuments\StartUpStep::shouldInterceptRequest ( )
Returns
bool

Reimplemented from ILIAS\Init\StartupSequence\StartUpSequenceStep.

Definition at line 49 of file StartUpStep.php.

49 : bool
50 {
51 return $this->current->intercept();
52 }

◆ shouldStoreRequestTarget()

ILIAS\LegalDocuments\StartUpStep::shouldStoreRequestTarget ( )
Returns
bool

Reimplemented from ILIAS\Init\StartupSequence\StartUpSequenceStep.

Definition at line 44 of file StartUpStep.php.

44 : bool
45 {
46 return true;
47 }

Field Documentation

◆ $all

readonly array ILIAS\LegalDocuments\StartUpStep::$all
private

Definition at line 35 of file StartUpStep.php.

◆ $current

readonly Intercept ILIAS\LegalDocuments\StartUpStep::$current
private

Definition at line 36 of file StartUpStep.php.


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