Passed
Pull Request — master (#5720)
by
unknown
07:02
created

CBlogTaskRelUser   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 29
c 1
b 0
f 1
dl 0
loc 65
rs 10
wmc 7

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getIid() 0 3 1
A getBlog() 0 3 1
A setTask() 0 5 1
A getTask() 0 3 1
A getTargetDate() 0 3 1
A setBlog() 0 5 1
A setTargetDate() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
/* For licensing terms, see /license.txt */
6
7
namespace Chamilo\CourseBundle\Entity;
8
9
use Chamilo\CoreBundle\Entity\User;
10
use Chamilo\CoreBundle\Traits\UserTrait;
11
use Doctrine\ORM\Mapping as ORM;
12
13
#[ORM\Table(name: 'c_blog_task_rel_user')]
14
#[ORM\Entity]
15
class CBlogTaskRelUser
16
{
17
    use UserTrait;
18
19
    #[ORM\Column(name: 'iid', type: 'integer')]
20
    #[ORM\Id]
21
    #[ORM\GeneratedValue]
22
    protected ?int $iid = null;
23
24
    #[ORM\Column(name: 'target_date', type: 'date', nullable: false)]
25
    protected \DateTime $targetDate;
26
27
    #[ORM\ManyToOne(targetEntity: CBlogTask::class)]
28
    #[ORM\JoinColumn(name: 'task_id', referencedColumnName: 'iid', onDelete: 'CASCADE')]
29
    protected ?CBlogTask $task = null;
30
31
    #[ORM\ManyToOne(targetEntity: CBlog::class)]
32
    #[ORM\JoinColumn(name: 'blog_id', referencedColumnName: 'iid', onDelete: 'CASCADE')]
33
    protected ?CBlog $blog = null;
34
35
    #[ORM\ManyToOne(targetEntity: User::class)]
36
    #[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
37
    protected User $user;
38
39
    public function getIid(): ?int
40
    {
41
        return $this->iid;
42
    }
43
44
    public function getTargetDate(): \DateTime
45
    {
46
        return $this->targetDate;
47
    }
48
49
    public function setTargetDate(\DateTime $targetDate): self
50
    {
51
        $this->targetDate = $targetDate;
52
53
        return $this;
54
    }
55
56
    public function getTask(): ?CBlogTask
57
    {
58
        return $this->task;
59
    }
60
61
    public function setTask(?CBlogTask $task): self
62
    {
63
        $this->task = $task;
64
65
        return $this;
66
    }
67
68
    public function getBlog(): ?CBlog
69
    {
70
        return $this->blog;
71
    }
72
73
    public function setBlog(?CBlog $blog): self
74
    {
75
        $this->blog = $blog;
76
77
        return $this;
78
    }
79
}
80