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

PersonalFile::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 Chamilo\CoreBundle\Entity\Resource\AbstractResource;
7
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
8
use Doctrine\ORM\Mapping as ORM;
9
use Gedmo\Timestampable\Traits\TimestampableEntity;
10
11
/**
12
 * PersonalFiles.
13
 *
14
 * @ORM\Table(name="personal_file")
15
 * @ORM\Entity
16
 */
17
class PersonalFile extends AbstractResource implements ResourceInterface
18
{
19
    use TimestampableEntity;
20
21
    /**
22
     * @var int
23
     *
24
     * @ORM\Column(name="id", type="integer")
25
     * @ORM\Id
26
     * @ORM\GeneratedValue(strategy="AUTO")
27
     */
28
    protected $id;
29
30
    /**
31
     * @var string
32
     *
33
     * @ORM\Column(name="name", type="string", length=255, nullable=false)
34
     */
35
    protected $name;
36
37
    /**
38
     * Illustration constructor.
39
     */
40
    public function __construct()
41
    {
42
        $this->name = 'personal_file';
43
    }
44
45
    public function getId(): int
46
    {
47
        return $this->id;
48
    }
49
50
    public function setId(int $id): PersonalFile
51
    {
52
        $this->id = $id;
53
54
        return $this;
55
    }
56
57
    public function getName(): string
58
    {
59
        return (string) $this->name;
60
    }
61
62
    public function setName(string $name): PersonalFile
63
    {
64
        $this->name = $name;
65
66
        return $this;
67
    }
68
69
    /**
70
     * Resource identifier.
71
     */
72
    public function getResourceIdentifier(): int
73
    {
74
        return $this->getId();
75
    }
76
77
    public function getResourceName(): string
78
    {
79
        return $this->getName();
80
    }
81
82
    public function __toString(): string
83
    {
84
        return $this->getName();
85
    }
86
}
87