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

CShortcut::setResourceName()   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
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
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