Completed
Push — master ( b05893...eedd1b )
by Julito
09:17
created

AbstractTool::getTarget()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/* For licensing terms, see /license.txt */
3
4
namespace Chamilo\CoreBundle\Tool;
5
6
use Sonata\CoreBundle\Model\BaseEntityManager;
7
use Sylius\Bundle\SettingsBundle\Schema\SchemaInterface;
8
9
/**
10
 * Class AbstractTool.
11
 */
12
abstract class AbstractTool implements ToolInterface
13
{
14
    protected $name;
15
    protected $category;
16
    protected $link;
17
    protected $image;
18
    protected $admin;
19
    protected $courseSettings;
20
    protected $manager;
21
    protected $types;
22
23
    /**
24
     * @param string $name
25
     * @param string $category
26
     * @param string $link
27
     * @param string $image
28
     * @param        $courseSettings
29
     * @param array  $types
30
     * @param array  $admin
31
     */
32
    public function __construct($name, $category, $link, $image, $courseSettings, $types, $admin)
33
    {
34
        $this->name = $name;
35
        $this->category = $category;
36
        $this->link = $link;
37
        $this->image = $image;
38
        $this->admin = (int) $admin;
39
        $this->courseSettings = $courseSettings;
40
        $this->types = $types;
41
    }
42
43
    /**
44
     * {@inheritdoc}
45
     */
46
    public function getName()
47
    {
48
        return $this->name;
49
    }
50
51
    /**
52
     * {@inheritdoc}
53
     */
54
    public function getLink()
55
    {
56
        return $this->link;
57
    }
58
59
    /**
60
     * {@inheritdoc}
61
     */
62
    public function getCategory()
63
    {
64
        return $this->category;
65
    }
66
67
    /**
68
     * {@inheritdoc}
69
     */
70
    public function getTarget()
71
    {
72
        return '_self';
73
    }
74
75
    /**
76
     * {@inheritdoc}
77
     */
78
    public function getImage()
79
    {
80
        return $this->image;
81
    }
82
83
    /**
84
     * @param int $admin
85
     */
86
    public function setAdmin($admin)
87
    {
88
        $this->admin = $admin;
89
    }
90
91
    /**
92
     * @return int
93
     */
94
    public function getAdmin(): int
95
    {
96
        return (int) $this->admin;
97
    }
98
99
    /**
100
     * @return BaseEntityManager;
101
     */
102
    public function getManager()
103
    {
104
        return $this->manager;
105
    }
106
107
    /**
108
     * @param $settings
109
     *
110
     * @return int
111
     */
112
    public function setCourseSettings($settings)
113
    {
114
        $this->courseSettings = $settings;
115
    }
116
117
    /**
118
     * @return SchemaInterface
119
     */
120
    public function getCourseSettings()
121
    {
122
        return $this->courseSettings;
123
    }
124
125
    /**
126
     * @param string $type
127
     */
128
    public function addType($type)
129
    {
130
        $this->types[] = $type;
131
    }
132
133
    /**
134
     * @return array
135
     */
136
    public function getTypes()
137
    {
138
        return $this->types;
139
    }
140
}
141