Completed
Branch feature/pre-split (ce4b6b)
by Anton
05:23
created

RootLoader   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
1
<?php
2
/**
3
 * components
4
 *
5
 * @author    Wolfy-J
6
 */
7
namespace Spiral\ORM\Entities\Loaders;
8
9
use Spiral\Database\Builders\SelectQuery;
10
use Spiral\ORM\ORMInterface;
11
12
/**
13
 * Primary ORM loader.
14
 */
15
class RootLoader
16
{
17
    /**
18
     * @var string
19
     */
20
    private $class;
21
22
    /**
23
     * @invisible
24
     * @var ORMInterface
25
     */
26
    private $orm;
27
28
    /**
29
     * @var SelectQuery
30
     */
31
    private $select;
32
33
    /**
34
     * @param string       $class
35
     * @param ORMInterface $orm
36
     */
37
    public function __construct(string $class, ORMInterface $orm)
38
    {
39
        $this->class = $class;
40
        $this->orm = $orm;
41
42
        //Getting our initial select query
43
        $this->select = $orm->table($class)->select();
44
    }
45
}