ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 ()
 
- Public Member Functions inherited from ILIAS\Init\StartupSequence\StartUpSequenceStep
 shouldStoreRequestTarget ()
 
 shouldInterceptRequest ()
 
 isInFulfillment ()
 
 execute ()
 

Private Member Functions

 allInterceptingPaths ()
 
 findCurrent ()
 
 find (Closure $predicate, array $array)
 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.

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

39  {
40  $this->all = $legal_documents->intercepting();
41  $this->current = new LazyIntercept($this->findCurrent(...));
42  }
+ 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.

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

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  }
+ Here is the caller graph for this function:

◆ execute()

ILIAS\LegalDocuments\StartUpStep::execute ( )

Definition at line 54 of file StartUpStep.php.

References ILIAS\Repository\ctrl().

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  }
+ Here is the call graph for this function:

◆ find()

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

A

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

Definition at line 98 of file StartUpStep.php.

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

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  }
+ Here is the caller graph for this function:

◆ findCurrent()

ILIAS\LegalDocuments\StartUpStep::findCurrent ( )
private

Definition at line 81 of file StartUpStep.php.

References ILIAS\LegalDocuments\StartUpStep\$all, and ILIAS\LegalDocuments\StartUpStep\find().

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

81  : Intercept
82  {
83  return $this->find(
84  fn($x) => $x->intercept(),
86  )->except(
87  fn() => new Ok(new NullIntercept())
88  )->value();
89  }
find(Closure $predicate, array $array)
A
Definition: StartUpStep.php:98
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isInFulfillment()

ILIAS\LegalDocuments\StartUpStep::isInFulfillment ( )

Definition at line 61 of file StartUpStep.php.

References ILIAS\LegalDocuments\StartUpStep\allInterceptingPaths(), and ILIAS\Repository\ctrl().

61  : bool
62  {
63  return in_array(
64  strtolower($this->ctrl->getCmdClass() ?? ''),
65  $this->allInterceptingPaths(),
66  true
67  );
68  }
+ Here is the call graph for this function:

◆ shouldInterceptRequest()

ILIAS\LegalDocuments\StartUpStep::shouldInterceptRequest ( )

Definition at line 49 of file StartUpStep.php.

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

◆ shouldStoreRequestTarget()

ILIAS\LegalDocuments\StartUpStep::shouldStoreRequestTarget ( )

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.

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

◆ $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: