Total Complexity | 6 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Coverage | 50% |
Changes | 0 |
1 | <?php |
||
9 | abstract class RowsDTO extends EventDTO |
||
10 | { |
||
11 | private $values; |
||
12 | private $changedRows; |
||
13 | private $tableMap; |
||
14 | |||
15 | 57 | public function __construct( |
|
16 | EventInfo $eventInfo, |
||
17 | TableMap $tableMap, |
||
18 | int $changedRows, |
||
19 | array $values |
||
20 | ) { |
||
21 | 57 | parent::__construct($eventInfo); |
|
22 | |||
23 | 57 | $this->changedRows = $changedRows; |
|
24 | 57 | $this->values = $values; |
|
25 | 57 | $this->tableMap = $tableMap; |
|
26 | } |
||
27 | |||
28 | 1 | public function getTableMap(): TableMap |
|
29 | { |
||
30 | 1 | return $this->tableMap; |
|
31 | } |
||
32 | |||
33 | 1 | public function getChangedRows(): int |
|
34 | { |
||
35 | 1 | return $this->changedRows; |
|
36 | } |
||
37 | |||
38 | 57 | public function getValues(): array |
|
39 | { |
||
40 | 57 | return $this->values; |
|
41 | } |
||
42 | |||
43 | public function __toString(): string |
||
44 | { |
||
45 | return PHP_EOL . |
||
46 | '=== Event ' . $this->getType() . ' === ' . PHP_EOL . |
||
47 | 'Date: ' . $this->eventInfo->getDateTime() . PHP_EOL . |
||
48 | 'Log position: ' . $this->eventInfo->getPos() . PHP_EOL . |
||
49 | 'Event size: ' . $this->eventInfo->getSize() . PHP_EOL . |
||
50 | 'Table: ' . $this->tableMap->getTable() . PHP_EOL . |
||
51 | 'Affected columns: ' . $this->tableMap->getColumnsAmount() . PHP_EOL . |
||
52 | 'Changed rows: ' . $this->changedRows . PHP_EOL . |
||
53 | 'Values: ' . print_r($this->values, true) . PHP_EOL; |
||
|
|||
54 | } |
||
55 | |||
56 | public function jsonSerialize() |
||
59 | } |
||
60 | } |