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

Article::setSection()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 6
Ratio 100 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 6
loc 6
rs 9.4285
cc 1
eloc 3
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="articles")
9
 */
10 View Code Duplication
class Article
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\ManyToOne(name="section", targetEntity="Section")
25
     */
26
    private $section;
27
28
    public function setId($id)
29
    {
30
        $this->id = $id;
31
    }
32
33
    public function getId()
34
    {
35
        return $this->id;
36
    }
37
38
    /**
39
     * Getter for iri
40
     *
41
     * @return string
42
     */
43
    public function getIri()
44
    {
45
        return $this->iri;
46
    }
47
48
    /**
49
     * Setter for iri
50
     *
51
     * @param string $iri
52
     * @return Article
53
     */
54
    public function setIri($iri)
55
    {
56
        $this->iri = $iri;
57
58
        return $this;
59
    }
60
61
    public function setSection(Section $section)
62
    {
63
        $this->section = $section;
64
65
        $this->section->addArticle($this);
66
    }
67
68
    public function getSection()
69
    {
70
        return $this->section;
71
    }
72
}
73