Completed
Push — develop ( c115d0...f0eafc )
by Carlo
03:05
created

Admin::build()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 10
rs 9.4285
cc 2
eloc 6
nc 2
nop 0
1
<?php
2
3
namespace Magefix\Fixture\Builder;
4
5
/**
6
 * Class Admin
7
 *
8
 * @package Magefix\Fixture\Builder
9
 * @author  Daniel Kidanemariam <[email protected]>
10
 */
11
class Admin extends AbstractBuilder
12
{
13
    /**
14
     * @return int
15
     * @throws \Exception
16
     *
17
     */
18
    public function build()
19
    {
20
        $this->iterateFixture();
21
        $defaultData = $this->_getMageModelData() ? $this->_getMageModelData() : [];
22
        $mergedData = array_merge($defaultData, $this->_getFixtureAttributes());
23
24
        $this->_getMageModel()->setData($mergedData);
25
26
        return $this->_saveFixture();
27
    }
28
}
29