ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
Counter.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 2016 Richard Klees <richard.klees@concepts-and-training.de> Extended GPL, see docs/LICENSE */
4 
6 
9 
10 class Counter implements Spec
11 {
12  use ComponentHelper;
13 
14  private static $types = array( self::NOVELTY
15  , self::STATUS
16  );
17 
21  private $type;
22 
26  private $number;
27 
32  public function __construct($type, $number)
33  {
34  $this->checkArgIsElement("type", $type, self::$types, "counter type");
35  $this->checkIntArg("number", $number);
36  $this->type = $type;
37  $this->number = $number;
38  }
39 
43  public function getType()
44  {
45  return $this->type;
46  }
47 
51  public function getNumber()
52  {
53  return $this->number;
54  }
55 }
getNumber()
Get the number on the counter.int
Definition: Counter.php:51
checkArgIsElement($which, $value, $array, $name)
Throw an InvalidArgumentException if $value is not an element of array.
trait ComponentHelper
Provides common functionality for component implementations.
getType()
Get the type of the counter.string One of the counter types.
Definition: Counter.php:43
Create styles array
The data for the language used.
checkIntArg($which, $value)
Throw an InvalidArgumentException if $value is no int.