ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
Config.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\LegalDocuments;
22 
24 
25 class Config
26 {
27  public function __construct(
28  private readonly Provide $provide,
29  private readonly bool $editable = false
30  ) {
31  }
32 
33  public function editable(): bool
34  {
35  return $this->editable;
36  }
37 
38  public function allowEditing(): self
39  {
40  return new self($this->provide, true);
41  }
42 
43  public function legalDocuments(): Provide
44  {
45  if ($this->editable()) {
46  return $this->provide->allowEditing();
47  }
48  return $this->provide;
49  }
50 }
__construct(private readonly Provide $provide, private readonly bool $editable=false)
Definition: Config.php:27