Completed
Push — master ( 05bb5a...5289b8 )
by Rafał
34:32 queued 04:15
created

RelatedArticle   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 2
dl 0
loc 46
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getId() 0 4 1
A getRelatesTo() 0 4 1
A setRelatesTo() 0 4 1
A getArticle() 0 4 1
A setArticle() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Superdesk Publisher Content Bundle.
7
 *
8
 * Copyright 2019 Sourcefabric z.ú. and contributors.
9
 *
10
 * For the full copyright and license information, please see the
11
 * AUTHORS and LICENSE files distributed with this source code.
12
 *
13
 * @copyright 2019 Sourcefabric z.ú
14
 * @license http://www.superdesk.org/license
15
 */
16
17
namespace SWP\Bundle\ContentBundle\Model;
18
19
use SWP\Component\Common\Model\SoftDeletableTrait;
20
use SWP\Component\Common\Model\TimestampableTrait;
21
22
class RelatedArticle implements RelatedArticleInterface
23
{
24
    use TimestampableTrait, SoftDeletableTrait;
25
26
    protected $id;
27
28
    /**
29
     * @var ArticleInterface
30
     */
31
    protected $relatesTo;
32
33
    /**
34
     * @var ArticleInterface
35
     */
36
    protected $article;
37
38
    public function __construct()
39
    {
40
        $this->createdAt = new \DateTime();
41
    }
42
43
    public function getId(): int
44
    {
45
        return $this->id;
46
    }
47
48
    public function getRelatesTo(): ?ArticleInterface
49
    {
50
        return $this->relatesTo;
51
    }
52
53
    public function setRelatesTo(?ArticleInterface $relatesTo): void
54
    {
55
        $this->relatesTo = $relatesTo;
56
    }
57
58
    public function getArticle(): ArticleInterface
59
    {
60
        return $this->article;
61
    }
62
63
    public function setArticle(ArticleInterface $article): void
64
    {
65
        $this->article = $article;
66
    }
67
}
68