Completed
Pull Request — master (#47)
by Julien
03:47
created

Section::addArticle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 4
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Mapado\RestClientSdk\Tests\Model\Issue46;
4
5
use Mapado\RestClientSdk\Mapping\Annotations as Rest;
6
7
/**
8
 * @Rest\Entity(key="sections")
9
 */
10 View Code Duplication
class Section
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
11
{
12
    /**
13
     * @Rest\Id
14
     * @Rest\Attribute(name="@id", type="string")
15
     */
16
    private $iri;
17
18
    /**
19
     * @Rest\Attribute(name="id", type="string")
20
     */
21
    private $id;
22
23
    /**
24
     * @Rest\Attribute(name="title", type="string")
25
     */
26
    private $title;
27
28
    /**
29
     * @Rest\OneToMany(name="articleList", targetEntity="Article")
30
     */
31
    private $articleList = [];
32
33
    public function setId($id)
34
    {
35
        $this->id = $id;
36
    }
37
38
    public function getId()
39
    {
40
        return $this->id;
41
    }
42
43
    /**
44
     * Getter for iri
45
     *
46
     * @return string
47
     */
48
    public function getIri()
49
    {
50
        return $this->iri;
51
    }
52
53
    /**
54
     * Setter for iri
55
     *
56
     * @param string $iri
57
     * @return Section
58
     */
59
    public function setIri($iri)
60
    {
61
        $this->iri = $iri;
62
63
        return $this;
64
    }
65
66
    public function setTitle($title)
67
    {
68
        $this->title = $title;
69
    }
70
71
    public function getTitle()
72
    {
73
        return $this->title;
74
    }
75
76
    public function addArticle(Article $article)
77
    {
78
        $this->articleList[] = $article;
79
    }
80
81
    public function getArticleList()
82
    {
83
        return $this->articleList;
84
    }
85
}
86