ILIAS  trunk Revision v12.0_alpha-1540-g00f839d5fa1
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 protected bool $has_eligible_copyright
39 ) {
40 }
41
42 public function isPublishingRelevant(): bool
43 {
44 return $this->is_publishing_relevant;
45 }
46
50 public function getAllPossibleStatuses(): array
51 {
52 return $this->all_statuses;
53 }
54
55 public function getCurrentStatus(): Status
56 {
57 return $this->current_status;
58 }
59
63 public function getRelevantActions(): array
64 {
65 return $this->relevant_actions;
66 }
67
68 public function isActionAvailable(Action $action): bool
69 {
70 return in_array($action, $this->relevant_actions) && !in_array($action, $this->unavailable_actions);
71 }
72
76 public function getAllEligibleCopyrightEntryIDs(): array
77 {
78 return $this->eligible_copyright_entry_ids;
79 }
80
81 public function hasEligibleCopyright(): bool
82 {
83 return $this->has_eligible_copyright;
84 }
85}
isActionAvailable(Action $action)
Returns false both if the action should not be offered at all in the current context,...
Definition: StateInfo.php:68
__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, protected bool $has_eligible_copyright)
Definition: StateInfo.php:31