Passed
Push — dependabot/npm_and_yarn/microm... ( e84ba6...f2f212 )
by
unknown
10:03
created

CBlogRelUser   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 18
c 1
b 0
f 1
dl 0
loc 34
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getBlog() 0 3 1
A setBlog() 0 5 1
A getIid() 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
#[ORM\Table(name: 'c_blog_rel_user')]
14
#[ORM\Entity]
15
class CBlogRelUser
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\ManyToOne(targetEntity: CBlog::class)]
25
    #[ORM\JoinColumn(name: 'blog_id', referencedColumnName: 'iid', onDelete: 'CASCADE')]
26
    protected ?CBlog $blog = null;
27
28
    #[ORM\ManyToOne(targetEntity: User::class)]
29
    #[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
30
    protected User $user;
31
32
    public function getIid(): ?int
33
    {
34
        return $this->iid;
35
    }
36
37
    public function getBlog(): ?CBlog
38
    {
39
        return $this->blog;
40
    }
41
42
    public function setBlog(?CBlog $blog): self
43
    {
44
        $this->blog = $blog;
45
46
        return $this;
47
    }
48
}
49