EventCollectionObjectRepresentation   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 44
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 15 1
A addEvent() 0 3 1
1
<?php
2
/**
3
 * This file is part of the Simple EventStore Manager package.
4
 *
5
 * (c) Mauro Cassani<https://github.com/mauretto78>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace SimpleEventStoreManager\Infrastructure\DataTransformers\Representations;
12
13
class EventCollectionObjectRepresentation
14
{
15
    private $page;
16
    private $recordsPerPage;
17
    private $totalPages;
18
    private $totalCount;
19
    private $currentLink;
20
    private $prevLink;
21
    private $nextLink;
22
    private $lastLink;
23
    private $events;
24
25
    /**
26
     * EventsCollection constructor.
27
     *
28
     * @param $page
29
     * @param $recordsPerPage
30
     * @param $totalPages
31
     * @param $totalCount
32
     * @param $links
33
     */
34
    public function __construct(
35
        $page,
36
        $recordsPerPage,
37
        $totalPages,
38
        $totalCount,
39
        $links
40
    ) {
41
        $this->page = $page;
42
        $this->recordsPerPage = $recordsPerPage;
43
        $this->totalPages = $totalPages;
44
        $this->totalCount = $totalCount;
45
        $this->currentLink = $links['current'];
46
        $this->prevLink = $links['prev'];
47
        $this->nextLink = $links['next'];
48
        $this->lastLink = $links['last'];
49
    }
50
51
    /**
52
     * @param EventObjectRepresentation $event
53
     */
54
    public function addEvent(EventObjectRepresentation $event)
55
    {
56
        $this->events[] = $event;
57
    }
58
}
59