Passed
Push — master ( 445983...d786ab )
by Yannick
39:28
created

CAutogroupUserInvitation   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 74
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 31
c 1
b 0
f 0
dl 0
loc 74
rs 10
wmc 9

9 Methods

Rating   Name   Duplication   Size   Complexity  
A getGroupCategory() 0 3 1
A setGroupCategory() 0 5 1
A setGroup() 0 5 1
A getId() 0 3 1
A setId() 0 5 1
A setConfirm() 0 5 1
A getGroup() 0 3 1
A __construct() 0 1 1
A getConfirm() 0 3 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
/**
14
 * CAutogroupUserInvitation
15
 * Represents the invitation of a user to join a group in a specific category.
16
 */
17
#[ORM\Table(name: 'c_autogroup_user_invitation')]
18
#[ORM\Entity]
19
class CAutogroupUserInvitation
20
{
21
    use UserTrait;
22
23
    #[ORM\Id]
24
    #[ORM\Column(type: 'integer')]
25
    #[ORM\GeneratedValue]
26
    protected ?int $id = null;
27
28
    #[ORM\ManyToOne(targetEntity: CGroupCategory::class)]
29
    #[ORM\JoinColumn(name: 'group_category_id', referencedColumnName: 'iid', nullable: false, onDelete: 'CASCADE')]
30
    protected ?CGroupCategory $groupCategory = null;
31
32
    #[ORM\ManyToOne(targetEntity: CGroup::class)]
33
    #[ORM\JoinColumn(name: 'group_id', referencedColumnName: 'iid', nullable: false, onDelete: 'CASCADE')]
34
    protected ?CGroup $group = null;
35
36
    #[ORM\ManyToOne(targetEntity: User::class)]
37
    #[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
38
    protected ?User $user = null;
39
40
    #[ORM\Column(type: 'boolean', nullable: true)]
41
    protected ?bool $confirm = null;
42
43
    public function __construct() {}
44
45
    public function getId(): ?int
46
    {
47
        return $this->id;
48
    }
49
50
    public function setId(int $id): self
51
    {
52
        $this->id = $id;
53
54
        return $this;
55
    }
56
57
    public function getGroupCategory(): ?CGroupCategory
58
    {
59
        return $this->groupCategory;
60
    }
61
62
    public function setGroupCategory(?CGroupCategory $groupCategory): self
63
    {
64
        $this->groupCategory = $groupCategory;
65
66
        return $this;
67
    }
68
69
    public function getGroup(): ?CGroup
70
    {
71
        return $this->group;
72
    }
73
74
    public function setGroup(?CGroup $group): self
75
    {
76
        $this->group = $group;
77
78
        return $this;
79
    }
80
81
    public function getConfirm(): ?bool
82
    {
83
        return $this->confirm;
84
    }
85
86
    public function setConfirm(?bool $confirm): self
87
    {
88
        $this->confirm = $confirm;
89
90
        return $this;
91
    }
92
}
93