ClonerOptions::getRelations()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * @year    2016
4
 * @link    https://github.com/nnx-framework/cloner
5
 * @author  Lobanov Aleksandr <[email protected]>
6
 */
7
8
namespace Nnx\Cloner\Options;
9
10
use Zend\Stdlib\AbstractOptions;
11
12
/**
13
 * Class ClonerOptions
14
 *
15
 * @package Nnx\Cloner\Options
16
 */
17
class ClonerOptions extends AbstractOptions
18
{
19
20
    /**
21
     * @var string создаваемый класс клонера
22
     */
23
    protected $class;
24
25
    /**
26
     * @var Cloner\RelationOptions[]
27
     */
28
    protected $relations = [];
29
30
    /**
31
     * @return string
32
     */
33
    public function getClass()
34
    {
35
        return $this->class;
36
    }
37
38
    /**
39
     * @param string $class
40
     *
41
     * @return $this
42
     */
43
    public function setClass($class)
44
    {
45
        $this->class = $class;
46
        return $this;
47
    }
48
49
    /**
50
     * @return Cloner\RelationOptions[]
51
     */
52
    public function getRelations()
53
    {
54
        return $this->relations;
55
    }
56
57
    /**
58
     * @param array $relations
59
     *
60
     * @return $this
61
     */
62
    public function setRelations($relations)
63
    {
64
        foreach ($relations as $name => $options) {
65
            $this->relations[$name] = new Cloner\RelationOptions($options);
66
        }
67
        return $this;
68
    }
69
}
70