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

ArrayNode   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A registerData() 0 14 2
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
}