News   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 71.43%

Importance

Changes 0
Metric Value
dl 0
loc 26
ccs 5
cts 7
cp 0.7143
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getType() 0 3 1
A setCommunity() 0 5 1
A getCommunity() 0 3 1
1
<?php
2
3
namespace App\Entity\Community;
4
5
use App\Entity\News as NewsModel;
6
7
use Doctrine\ORM\Mapping as ORM;
8
9
/**
10
 * @ORM\Entity(repositoryClass="App\Repository\Community\NewsRepository")
11
 * @ORM\Table(name="communities__news")
12
 */
13
class News extends NewsModel
14
{
15
    /**
16
     * @ORM\ManyToOne(targetEntity="Community")
17
     */
18
    protected $community;
19
    
20
    const CATEGORY_COMMUNITY_CREATION = 'community_creation';
21
    const CATEGORY_NEW_MEMBER = 'new_member';
22
    const CATEGORY_NEW_PROJECT = 'new_project';
23
    
24
    public function getType(): string
25
    {
26
        return self::TYPE_COMMUNITY;
27
    }
28
    
29 2
    public function setCommunity(Community $community): News
30
    {
31 2
        $this->community = $community;
32
        
33 2
        return $this;
34
    }
35
    
36 1
    public function getCommunity(): Community
37
    {
38 1
        return $this->community;
39
    }
40
}