ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
StateInfo.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24{
31 public function __construct(
32 protected bool $is_publishing_relevant,
33 protected Status $current_status,
34 protected array $all_statuses,
35 protected array $relevant_actions,
36 protected array $unavailable_actions,
37 protected array $eligible_copyright_entry_ids
38 ) {
39 }
40
41 public function isPublishingRelevant(): bool
42 {
43 return $this->is_publishing_relevant;
44 }
45
49 public function getAllPossibleStatuses(): array
50 {
51 return $this->all_statuses;
52 }
53
54 public function getCurrentStatus(): Status
55 {
56 return $this->current_status;
57 }
58
62 public function getRelevantActions(): array
63 {
64 return $this->relevant_actions;
65 }
66
67 public function isActionAvailable(Action $action): bool
68 {
69 return in_array($action, $this->relevant_actions) && !in_array($action, $this->unavailable_actions);
70 }
71
75 public function getAllEligibleCopyrightEntryIDs(): array
76 {
77 return $this->eligible_copyright_entry_ids;
78 }
79}
__construct(protected bool $is_publishing_relevant, protected Status $current_status, protected array $all_statuses, protected array $relevant_actions, protected array $unavailable_actions, protected array $eligible_copyright_entry_ids)
Definition: StateInfo.php:31
isActionAvailable(Action $action)
Returns false both if the action should not be offered at all in the current context,...
Definition: StateInfo.php:67