Completed
Push — master ( db9c88...be5baf )
by Julito
14:58
created

CShortcut   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 68
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 14
c 1
b 0
f 0
dl 0
loc 68
rs 10
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getResourceIdentifier() 0 3 1
A __toString() 0 3 1
A getName() 0 3 1
A setName() 0 5 1
A getResourceName() 0 3 1
A setShortCutNode() 0 5 1
A setResourceName() 0 3 1
A getShortCutNode() 0 3 1
1
<?php
2
3
/* For licensing terms, see /license.txt */
4
5
namespace Chamilo\CourseBundle\Entity;
6
7
use Chamilo\CoreBundle\Entity\AbstractResource;
8
use Chamilo\CoreBundle\Entity\ResourceInterface;
9
use Chamilo\CoreBundle\Entity\ResourceNode;
10
use Doctrine\ORM\Mapping as ORM;
11
use Symfony\Component\Validator\Constraints as Assert;
12
13
/**
14
 * @ORM\Table(name="c_shortcut")
15
 * @ORM\Entity
16
 */
17
class CShortcut extends AbstractResource implements ResourceInterface
18
{
19
    /**
20
     * @var int
21
     *
22
     * @ORM\Column(name="id", type="integer")
23
     * @ORM\Id
24
     * @ORM\GeneratedValue
25
     */
26
    protected $id;
27
28
    /**
29
     * @Assert\NotBlank
30
     *
31
     * @ORM\Column(name="name", type="string", length=255, nullable=false)
32
     */
33
    protected $name;
34
35
    /**
36
     * @ORM\OneToOne(
37
     *     targetEntity="Chamilo\CoreBundle\Entity\ResourceNode"
38
     * )
39
     * @ORM\JoinColumn(name="shortcut_node_id", referencedColumnName="id")
40
     */
41
    protected $shortCutNode;
42
43
    public function __toString(): string
44
    {
45
        return $this->getName();
46
    }
47
48
    public function getName(): string
49
    {
50
        return $this->name;
51
    }
52
53
    public function setName(string $name): self
54
    {
55
        $this->name = $name;
56
57
        return $this;
58
    }
59
60
    public function getResourceIdentifier(): int
61
    {
62
        return $this->id;
63
    }
64
65
    public function getShortCutNode()
66
    {
67
        return $this->shortCutNode;
68
    }
69
70
    public function setShortCutNode(ResourceNode $shortCutNode): self
71
    {
72
        $this->shortCutNode = $shortCutNode;
73
74
        return $this;
75
    }
76
77
    public function getResourceName(): string
78
    {
79
        return $this->getName();
80
    }
81
82
    public function setResourceName(string $name): self
83
    {
84
        return $this->setName($name);
85
    }
86
}
87