News::getType()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
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
}