1 | <?php |
||
20 | class ParticipationEvent |
||
21 | { |
||
22 | /** |
||
23 | * This Event will be fired once a participation for a user is registered. |
||
24 | */ |
||
25 | const PARTICIPATION = 'phpab.participation'; |
||
26 | |||
27 | /** |
||
28 | * The test to participate in. |
||
29 | * |
||
30 | * @var TestInterface |
||
31 | */ |
||
32 | private $test; |
||
33 | |||
34 | /** |
||
35 | * The variant that is chosen. |
||
36 | * |
||
37 | * @var VariantInterface |
||
38 | */ |
||
39 | private $variant; |
||
40 | |||
41 | /** |
||
42 | * A flag indicating whether or not the user already participates in the test. |
||
43 | * |
||
44 | * @var boolean |
||
45 | */ |
||
46 | private $isNew; |
||
47 | |||
48 | /** |
||
49 | * Initializes a new instance of this class. |
||
50 | * @param TestInterface $test The Test the participation was registered for |
||
51 | * @param VariantInterface $variant The Variant the user is associated with |
||
52 | * @param boolean $isNew Indicates weather the user is new or has an old participation from the storage. |
||
53 | */ |
||
54 | 4 | public function __construct(TestInterface $test, VariantInterface $variant, $isNew) |
|
60 | |||
61 | /** |
||
62 | * Get the Test the participation was registered for |
||
63 | * |
||
64 | * @return TestInterface |
||
65 | */ |
||
66 | 1 | public function getTest() |
|
70 | |||
71 | /** |
||
72 | * Get the Variant the user is associated with |
||
73 | * |
||
74 | * @return VariantInterface |
||
75 | */ |
||
76 | 1 | public function getVariant() |
|
80 | |||
81 | /** |
||
82 | * Checks weather the participation of the user is new |
||
83 | * |
||
84 | * @return boolean |
||
85 | */ |
||
86 | 2 | public function isNew() |
|
90 | } |
||
91 |