Dependency   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 44
c 0
b 0
f 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getRelation() 0 4 1
A getOptions() 0 4 1
1
<?php
2
/**
3
 * Spiral Framework.
4
 *
5
 * @license   MIT
6
 * @author    Valentin, Anton Titov (Wolfy-J)
7
 */
8
9
namespace Spiral\Listing;
10
11
/**
12
 * Specifies required relations to be loaded for a listing sorter or filter (ORM only)
13
 */
14
final class Dependency
15
{
16
    /**
17
     * @var
18
     */
19
    private $relation;
20
21
    /**
22
     * @var array
23
     */
24
    private $options;
25
26
    /**
27
     * Constructing.
28
     *
29
     * @param string $relation
30
     * @param array  $options
31
     */
32
    public function __construct($relation, array $options = [])
33
    {
34
        $this->relation = $relation;
35
        $this->options = $options;
36
    }
37
38
    /**
39
     * Get relation to be loaded
40
     *
41
     * @return mixed
42
     */
43
    public function getRelation()
44
    {
45
        return $this->relation;
46
    }
47
48
    /**
49
     * Get options for pre-loaded relation
50
     *
51
     * @return array
52
     */
53
    public function getOptions()
54
    {
55
        return $this->options;
56
    }
57
}