ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Prompt.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
26use ILIAS\UI\Component\Counter\Factory as CounterFactory;
28
32abstract 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;
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}
Prompts are notifications from the system to the user.
Definition: Prompt.php:33
__construct(SignalGeneratorInterface $signal_generator, CounterFactory $counter_factory, string $name, Glyph $symbol)
Definition: Prompt.php:36
This tags a counter object.
Definition: Counter.php:29
This is how the factory for UI elements looks.
Definition: Factory.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Combined.php:21
$counter