Completed
Branch feature/pre-split (4c50c1)
by Anton
03:17
created

ArrayNode::registerData()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 14
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 8
nc 2
nop 1
dl 0
loc 14
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/**
3
 * components
4
 *
5
 * @author    Wolfy-J
6
 */
7
namespace Spiral\ORM\Entities\Nodes;
8
9
use Spiral\ORM\Exceptions\LoaderException;
10
11
class ArrayNode extends SinguralNode
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16
    protected function registerData(array &$data)
17
    {
18
        if (empty($this->parent)) {
19
            throw new LoaderException("Unable to register data tree, parent is missing");
20
        }
21
22
        //Mounting parsed data into parent under defined container
23
        $this->parent->mountArray(
24
            $this->container,
25
            $this->referenceKey,
26
            $data[$this->localKey],
27
            $data
28
        );
29
    }
30
}