ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
Prompt.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 2018 Nils Haagen <nils.haagen@concepts-and-training.de> Extended GPL, see docs/LICENSE */
4
6
11use ILIAS\UI\Component\Counter\Factory as CounterFactory;
13
17abstract class Prompt extends Slate implements ISlate\Prompt
18{
23
24 public function __construct(
25 SignalGeneratorInterface $signal_generator,
26 CounterFactory $counter_factory,
27 string $name,
29 ) {
30 $this->counter_factory = $counter_factory;
31 parent::__construct($signal_generator, $name, $symbol);
32 }
33
34 protected function getCounterFactory() : CounterFactory
35 {
37 }
38
39 protected function updateCounter(Counter $counter) : ISlate\Prompt
40 {
41 $clone = clone $this;
42 $clone->symbol = $clone->symbol->withCounter($counter);
43 return $clone;
44 }
45
46 public function withUpdatedStatusCounter(int $count) : ISlate\Prompt
47 {
48 $counter = $this->getCounterFactory()->status($count);
49 return $this->updateCounter($counter);
50 }
51
52 public function withUpdatedNoveltyCounter(int $count) : ISlate\Prompt
53 {
54 $counter = $this->getCounterFactory()->novelty($count);
55 return $this->updateCounter($counter);
56 }
57}
An exception for terminatinating execution or to throw for unit testing.
Prompts are notifications from the system to the user.
Definition: Prompt.php:18
__construct(SignalGeneratorInterface $signal_generator, CounterFactory $counter_factory, string $name, Glyph $symbol)
Definition: Prompt.php:24
This tags a counter object.
Definition: Counter.php:11
This is how the factory for UI elements looks.
Definition: Factory.php:10
This describes how a glyph could be modified during construction of UI.
Definition: Glyph.php:14
This is how the factory for UI elements looks.
Definition: Factory.php:18
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc