Completed
Push — master ( fe8dc9...ddccce )
by Andrey
02:35
created

InsertCollection::getInsertedElement()   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
8
use Nnx\FormComparator\Comparator\AbstractDiff;
9
use Nnx\FormComparator\Comparator\DiffBuilder;
10
use Zend\Form\Element\Collection;
11
12
/**
13
 * Class InsertCollection
14
 *
15
 * @package Nnx\FormComparator\Comparator\Diff
16
 */
17
class InsertCollection extends AbstractDiff
18
{
19
    /**
20
     * Добавленная коллекция
21
     *
22
     * @var Collection
23
     */
24
    private $insertedCollection;
25
26
    /**
27
     * Элементы добавленной коллекции
28
     *
29
     * @var InsertElement[]
30
     */
31
    private $insertedElement = [];
32
33
    /**
34
     * Возвращает элементы добавленной коллекции
35
     *
36
     * @return InsertElement[]
37
     */
38
    public function getInsertedElement()
39
    {
40
        return $this->insertedElement;
41
    }
42
    /**
43
     * Возвращает добавленную коллекцию (нет в форме которую сравнивают, но есть в форме с которой сравнивают)
44
     *
45
     * @return Collection
46
     */
47
    public function getInsertedCollection()
48
    {
49
        return $this->insertedCollection;
50
    }
51
52
    /**
53
     * InsertElement constructor.
54
     *
55
     * @param DiffBuilder $diffBuilder
56
     */
57
    public function __construct(DiffBuilder $diffBuilder)
58
    {
59
        $this->insertedCollection = $diffBuilder->getTargetElement();
60
61
        parent::__construct($diffBuilder);
62
    }
63
}
64