ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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 ($predicate, $array)
 

Private Attributes

readonly array $all
 
readonly Intercept $current
 

Detailed Description

Definition at line 36 of file StartUpStep.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 42 of file StartUpStep.php.

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

43  {
44  $this->all = $legal_documents->intercepting();
45  $this->current = new LazyIntercept($this->findCurrent(...));
46  }
+ Here is the call graph for this function:

Member Function Documentation

◆ allInterceptingPaths()

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

Definition at line 77 of file StartUpStep.php.

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

77  : array
78  {
79  return array_map(
80  fn($intercept) => strtolower($intercept->target()->guiName()),
81  array_filter($this->all, fn($i) => $i->intercept())
82  );
83  }
+ Here is the caller graph for this function:

◆ execute()

ILIAS\LegalDocuments\StartUpStep::execute ( )

Definition at line 58 of file StartUpStep.php.

References ILIAS\Repository\ctrl().

58  : void
59  {
60  $target = $this->current->target();
61  $this->ctrl->setParameterByClass($target->guiName(), 'id', $this->current->id());
62  $this->ctrl->redirectToURL($this->ctrl->getLinkTargetByClass($target->guiPath(), $target->command()));
63  }
+ Here is the call graph for this function:

◆ find()

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

Definition at line 95 of file StartUpStep.php.

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

96  {
97  foreach ($array as $x) {
98  if ($predicate($x)) {
99  return new Ok($x);
100  }
101  }
102  return new Error('Not found.');
103  }
+ Here is the caller graph for this function:

◆ findCurrent()

ILIAS\LegalDocuments\StartUpStep::findCurrent ( )
private

Definition at line 85 of file StartUpStep.php.

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

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

86  {
87  return $this->find(
88  fn($x) => $x->intercept(),
90  )->except(
91  fn() => new Ok(new NullIntercept())
92  )->value();
93  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isInFulfillment()

ILIAS\LegalDocuments\StartUpStep::isInFulfillment ( )

Definition at line 65 of file StartUpStep.php.

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

65  : bool
66  {
67  return in_array(
68  strtolower($this->ctrl->getCmdClass()),
69  $this->allInterceptingPaths(),
70  true
71  );
72  }
+ Here is the call graph for this function:

◆ shouldInterceptRequest()

ILIAS\LegalDocuments\StartUpStep::shouldInterceptRequest ( )

Definition at line 53 of file StartUpStep.php.

53  : bool
54  {
55  return $this->current->intercept();
56  }

◆ shouldStoreRequestTarget()

ILIAS\LegalDocuments\StartUpStep::shouldStoreRequestTarget ( )

Definition at line 48 of file StartUpStep.php.

48  : bool
49  {
50  return true;
51  }

Field Documentation

◆ $all

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

Definition at line 39 of file StartUpStep.php.

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

◆ $current

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

Definition at line 40 of file StartUpStep.php.


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