RootNode::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
/**
3
 * Spiral, Core Components
4
 *
5
 * @author Wolfy-J
6
 */
7
8
namespace Spiral\ORM\Entities\Nodes;
9
10
use Spiral\ORM\Entities\Nodes\Traits\DuplicateTrait;
11
12
class RootNode extends OutputNode
13
{
14
    use DuplicateTrait;
15
16
    /**
17
     * @param array  $columns
18
     * @param string $primaryKey
19
     */
20
    public function __construct(array $columns = [], string $primaryKey)
21
    {
22
        parent::__construct($columns, null);
23
        $this->primaryKey = $primaryKey;
24
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    protected function pushData(array &$data)
30
    {
31
        $this->result[] = &$data;
32
    }
33
}