Completed
Push — master ( ddccce...70f96e )
by Andrey
02:38
created

AbstractCollectionElement   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 102
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 102
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A getRowIndex() 0 4 1
A getUniqueRowId() 0 4 1
A getSourceHash() 0 4 1
A getSourceCollectionElement() 0 4 1
A getPathToElement() 0 4 1
1
<?php
2
/**
3
 * @link    https://github.com/nnx-framework/form-comparator
4
 * @author  Malofeykin Andrey  <[email protected]>
5
 */
6
namespace Nnx\FormComparator\Comparator\Diff;
7
8
use Zend\Form\ElementInterface;
9
use Nnx\FormComparator\Comparator\DiffCollectionElementBuilder;
10
11
/**
12
 * Class AbstractCollectionElement
13
 *
14
 * @package Nnx\FormComparator\Comparator\Diff
15
 */
16
abstract class AbstractCollectionElement
17
{
18
    /**
19
     * Порядковый номер элмента коллекции
20
     *
21
     * @var integer
22
     */
23
    private $rowIndex;
24
25
    /**
26
     * Уникальный идендфификатор строки коллекци
27
     *
28
     * @var string
29
     */
30
    private $uniqueRowId;
31
32
    /**
33
     * Хеш значения элемента коллекции
34
     *
35
     * @var string
36
     */
37
    private $sourceHash;
38
39
    /**
40
     * Элемент коллекции 
41
     *
42
     * @var ElementInterface
43
     */
44
    private $sourceCollectionElement;
45
46
    /**
47
     * Путь до элемента
48
     *
49
     * @var string
50
     */
51
    private $pathToElement;
52
53
    /**
54
     * AbstractCollectionElement constructor.
55
     *
56
     * @param DiffCollectionElementBuilder $builder
57
     */
58
    public function __construct(DiffCollectionElementBuilder $builder)
59
    {
60
        $this->rowIndex = $builder->getRowIndex();
61
        $this->uniqueRowId = $builder->getUniqueRowId();
62
        $this->sourceHash = $builder->getSourceHash();
63
        $this->sourceCollectionElement = $builder->getSourceCollectionElement();
64
        $this->pathToElement = $builder->getPathToElement();
65
    }
66
67
68
    /**
69
     * Порядковый номер элмента коллекции
70
     *
71
     * @return int
72
     */
73
    public function getRowIndex()
74
    {
75
        return $this->rowIndex;
76
    }
77
78
    /**
79
     * Уникальный идендфификатор строки коллекци
80
     *
81
     * @return string
82
     */
83
    public function getUniqueRowId()
84
    {
85
        return $this->uniqueRowId;
86
    }
87
88
    /**
89
     * Хеш значения элемента коллекции
90
     *
91
     * @return string
92
     */
93
    public function getSourceHash()
94
    {
95
        return $this->sourceHash;
96
    }
97
98
    /**
99
     * Элемент коллекции
100
     *
101
     * @return ElementInterface
102
     */
103
    public function getSourceCollectionElement()
104
    {
105
        return $this->sourceCollectionElement;
106
    }
107
108
    /**
109
     * Возвращает путь до элемента
110
     *
111
     * @return string
112
     */
113
    public function getPathToElement()
114
    {
115
        return $this->pathToElement;
116
    }
117
}
118