ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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
10class Counter implements Spec
11{
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}
An exception for terminatinating execution or to throw for unit testing.
getNumber()
Get the number on the counter.int
Definition: Counter.php:51
getType()
Get the type of the counter.string One of the counter types.
Definition: Counter.php:43
This tags a counter object.
Definition: Counter.php:11
checkIntArg($which, $value)
Throw an InvalidArgumentException if $value is no int.
trait ComponentHelper
Provides common functionality for component implementations.
checkArgIsElement($which, $value, $array, $name)
Throw an InvalidArgumentException if $value is not an element of array.