Completed
Push — master ( d28136...3a5b5f )
by Julito
16:58
created

Illustration::getResourceFieldName()   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
nop 0
dl 0
loc 3
rs 10
nc 1
1
<?php
2
/* For licensing terms, see /license.txt */
3
4
namespace Chamilo\CoreBundle\Entity;
5
6
use APY\DataGridBundle\Grid\Mapping as GRID;
7
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
8
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
9
use Chamilo\CourseBundle\Traits\PersonalResourceTrait;
10
use Doctrine\ORM\Mapping as ORM;
11
use Gedmo\Timestampable\Traits\TimestampableEntity;
12
13
/**
14
 * Illustration.
15
 *
16
 * @ORM\Table(name="illustration")
17
 * @ORM\Entity
18
 * @GRID\Source(columns="id, name, resourceNode.createdAt", filterable=false, groups={"resource"})
19
 */
20
class Illustration extends AbstractResource implements ResourceInterface
21
{
22
    use PersonalResourceTrait;
23
    use TimestampableEntity;
24
25
    /**
26
     * @var int
27
     *
28
     * @ORM\Column(name="id", type="integer")
29
     * @ORM\Id
30
     * @ORM\GeneratedValue(strategy="AUTO")
31
     */
32
    protected $id;
33
34
    /**
35
     * @var string
36
     *
37
     * @ORM\Column(name="name", type="string", length=255, nullable=false)
38
     */
39
    protected $name;
40
41
    /**
42
     * Illustration constructor.
43
     */
44
    public function __construct()
45
    {
46
        $this->name = 'illustration';
47
    }
48
49
    public function getId(): int
50
    {
51
        return $this->id;
52
    }
53
54
    public function setId(int $id): Illustration
55
    {
56
        $this->id = $id;
57
58
        return $this;
59
    }
60
61
    public function getName(): string
62
    {
63
        return (string) $this->name;
64
    }
65
66
    public function setName(string $name): Illustration
67
    {
68
        $this->name = $name;
69
70
        return $this;
71
    }
72
73
    /**
74
     * Resource identifier.
75
     */
76
    public function getResourceIdentifier(): int
77
    {
78
        return $this->getId();
79
    }
80
81
    public function getResourceName(): string
82
    {
83
        return $this->getName();
84
    }
85
86
    public function __toString(): string
87
    {
88
        return $this->getName();
89
    }
90
}
91