ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ViewDefinition.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
24 
29 {
30  public const MODE_AS_TABLE = 1;
31  public const MODE_AS_ITEMS = 2;
32  public const MODE_AS_DECK = 3;
33  private int $mode = self::MODE_AS_TABLE;
34 
35  public function __construct(
36  private string $embedding_gui,
37  private string $embedding_cmd,
38  private string $title,
39  private int $items_per_page = 50,
40  private ?ResourceStakeholder $stakeholder = null,
41  private bool $enable_upload = false
42  ) {
43  if ($this->enable_upload && !$this->stakeholder instanceof ResourceStakeholder) {
44  throw new \InvalidArgumentException('If upload is enabled, a stakeholder must be provided');
45  }
46  }
47 
48  public function setMode(int $mode): void
49  {
50  $this->mode = $mode;
51  }
52 
53  public function getMode(): int
54  {
55  return $this->mode;
56  }
57 
58 
59  public function getEmbeddingGui(): string
60  {
61  return $this->embedding_gui;
62  }
63 
64  public function getEmbeddingCmd(): string
65  {
66  return $this->embedding_cmd;
67  }
68 
69  public function getTitle(): string
70  {
71  return $this->title;
72  }
73 
74  public function getItemsPerPage(): int
75  {
76  return $this->items_per_page;
77  }
78 
79  public function getStakeholder(): ?ResourceStakeholder
80  {
81  return $this->stakeholder;
82  }
83 
84  public function isEnableUpload(): bool
85  {
86  return $this->enable_upload;
87  }
88 }
__construct(private string $embedding_gui, private string $embedding_cmd, private string $title, private int $items_per_page=50, private ?ResourceStakeholder $stakeholder=null, private bool $enable_upload=false)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null