ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
Prompt.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
26 use ILIAS\UI\Component\Counter\Factory as CounterFactory;
28 
32 abstract class Prompt extends Slate implements ISlate\Prompt
33 {
34  protected CounterFactory $counter_factory;
35 
36  public function __construct(
38  CounterFactory $counter_factory,
39  string $name,
41  ) {
42  $this->counter_factory = $counter_factory;
43  parent::__construct($signal_generator, $name, $symbol);
44  }
45 
46  protected function getCounterFactory(): CounterFactory
47  {
49  }
50 
51  protected function updateCounter(Counter $counter): ISlate\Prompt
52  {
53  $clone = clone $this;
54  $clone->symbol = $clone->symbol->withCounter($counter);
55  return $clone;
56  }
57 
58  public function withUpdatedStatusCounter(int $count): ISlate\Prompt
59  {
60  $counter = $this->getCounterFactory()->status($count);
61  return $this->updateCounter($counter);
62  }
63 
64  public function withUpdatedNoveltyCounter(int $count): ISlate\Prompt
65  {
66  $counter = $this->getCounterFactory()->novelty($count);
67  return $this->updateCounter($counter);
68  }
69 }
withUpdatedStatusCounter(int $count)
Set the Prompt&#39;s Status Counter to $count.
Definition: Prompt.php:58
This tags a counter object.
Definition: Counter.php:28
This is how the factory for UI elements looks.
Definition: Factory.php:27
__construct(SignalGeneratorInterface $signal_generator, CounterFactory $counter_factory, string $name, Glyph $symbol)
Definition: Prompt.php:36
withUpdatedNoveltyCounter(int $count)
Set the Prompt&#39;s Novelty Counter to $count.
Definition: Prompt.php:64
Prompts are notifications from the system to the user.
Definition: Prompt.php:32
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Combined.php:21
__construct(Container $dic, ilPlugin $plugin)