News   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

3 Methods

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