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

getTargetCollectionElement()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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
use Nnx\FormComparator\Comparator\DiffCollectionElementBuilder;
8
use Zend\Form\ElementInterface;
9
10
/**
11
 * Class UpdateCollectionElement
12
 *
13
 * @package Nnx\FormComparator\Comparator\Diff
14
 */
15
class UpdateCollectionElement extends AbstractCollectionElement
16
{
17
    /**
18
     * Хеш значения элемента коллекции с которым сравнивают
19
     *
20
     * @var string
21
     */
22
    private $targetHash;
23
24
    /**
25
     * Элемент коллекции с которым сравнивают
26
     *
27
     * @var ElementInterface
28
     */
29
    private $targetCollectionElement;
30
31
    /***
32
     * UpdateCollectionElement constructor.
33
     *
34
     * @param DiffCollectionElementBuilder $builder
35
     */
36
    public function __construct(DiffCollectionElementBuilder $builder)
37
    {
38
        $this->targetHash = $builder->getTargetHash();
39
        $this->targetCollectionElement = $builder->getTargetCollectionElement();
40
41
        parent::__construct($builder);
42
    }
43
44
45
    /**
46
     * @return string
47
     */
48
    public function getTargetHash()
49
    {
50
        return $this->targetHash;
51
    }
52
53
    /**
54
     * @return ElementInterface
55
     */
56
    public function getTargetCollectionElement()
57
    {
58
        return $this->targetCollectionElement;
59
    }
60
61
62
}
63