|
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
|
|
|
|