Passed
Push — master ( b9a35c...ab20b0 )
by Julito
15:41
created

CStudentPublicationCorrection::setTitle()   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
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 Doctrine\ORM\Mapping as ORM;
10
use Symfony\Component\Validator\Constraints as Assert;
11
12
/**
13
 * @ORM\Table(
14
 *  name="c_student_publication_correction"
15
 * )
16
 * @ORM\Entity()
17
 */
18
class CStudentPublicationCorrection 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
     * @var string
31
     * @Assert\NotBlank()
32
     * @ORM\Column(name="title", type="string", length=255, nullable=true)
33
     */
34
    protected $title;
35
36
    public function __construct()
37
    {
38
    }
39
40
    /**
41
     * Set title.
42
     *
43
     * @param string $title
44
     *
45
     * @return CStudentPublication
46
     */
47
    public function setTitle($title)
48
    {
49
        $this->title = $title;
50
51
        return $this;
52
    }
53
54
    /**
55
     * Get title.
56
     *
57
     * @return string
58
     */
59
    public function getTitle()
60
    {
61
        return $this->title;
62
    }
63
64
    public function __toString(): string
65
    {
66
        return (string) $this->getTitle();
67
    }
68
69
    public function getId(): int
70
    {
71
        return $this->id;
72
    }
73
74
    /**
75
     * Resource identifier.
76
     */
77
    public function getResourceIdentifier(): int
78
    {
79
        return $this->getId();
80
    }
81
82
    public function getResourceName(): string
83
    {
84
        return $this->getTitle();
85
    }
86
87
    public function setResourceName(string $name): self
88
    {
89
        return $this->setTitle($name);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->setTitle($name) returns the type Chamilo\CourseBundle\Entity\CStudentPublication which is incompatible with the type-hinted return Chamilo\CourseBundle\Ent...ntPublicationCorrection.
Loading history...
90
    }
91
}
92