Completed
Push — master ( 792ce7...e487ad )
by Julito
21:06 queued 10s
created

CShortcut::setName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 10
1
<?php
2
/* For licensing terms, see /license.txt */
3
4
namespace Chamilo\CourseBundle\Entity;
5
6
use APY\DataGridBundle\Grid\Mapping as GRID;
7
8
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
9
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
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
 * @GRID\Source(columns="id, name, resourceNode.createdAt", filterable=false, groups={"resource"})
17
 */
18
class CShortcut extends AbstractResource implements ResourceInterface
19
{
20
    /**
21
     * @var int
22
     *
23
     * @ORM\Column(name="id", type="integer")
24
     * @ORM\Id
25
     * @ORM\GeneratedValue
26
     */
27
    protected $id;
28
29
    /**
30
     * @Assert\NotBlank
31
     *
32
     * @ORM\Column(name="name", type="string", length=255, nullable=false)
33
     */
34
    protected $name;
35
36
    /**
37
     * @return string
38
     */
39
    public function getName(): string
40
    {
41
        return $this->name;
42
    }
43
44
    /**
45
     * @param string $name
46
     *
47
     * @return CShortcut
48
     */
49
    public function setName(string $name): CShortcut
50
    {
51
        $this->name = $name;
52
53
        return $this;
54
    }
55
56
    /**
57
     * Resource identifier.
58
     */
59
    public function getResourceIdentifier(): int
60
    {
61
        return $this->id;
62
    }
63
64
    public function getResourceName(): string
65
    {
66
        return $this->getName();
67
    }
68
69
    public function __toString(): string
70
    {
71
        return $this->getName();
72
    }
73
}
74