Completed
Pull Request — master (#485)
by Maximilian
01:40
created

Content::setBody()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Symfony CMF package.
5
 *
6
 * (c) 2011-2017 Symfony CMF
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sonata\DoctrinePHPCRAdminBundle\Tests\Resources\Document;
13
14
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCRODM;
15
use PHPCR\NodeInterface;
16
17
/**
18
 * @PHPCRODM\Document(referenceable=true)
19
 */
20
class Content
21
{
22
    /**
23
     * @PHPCRODM\Id
24
     */
25
    protected $id;
26
27
    /**
28
     * @PHPCRODM\Node
29
     */
30
    protected $node;
31
32
    /**
33
     * @PHPCRODM\ParentDocument
34
     */
35
    protected $parentDocument;
36
37
    /**
38
     * @PHPCRODM\Nodename
39
     */
40
    protected $name;
41
42
    /**
43
     * @PHPCRODM\Field(type="string")
44
     */
45
    protected $title;
46
47
    /**
48
     * @PHPCRODM\Child()
49
     */
50
    protected $child;
51
52
    /**
53
     * @return mixed
54
     */
55
    public function getId()
56
    {
57
        return $this->id;
58
    }
59
60
    /**
61
     * Gets the underlying PHPCR node of this content.
62
     *
63
     * @return NodeInterface
64
     */
65
    public function getNode()
66
    {
67
        return $this->node;
68
    }
69
70
    /**
71
     * Sets the parent document.
72
     *
73
     * @param object $parent the parent document
74
     */
75
    public function setParentDocument($parent)
76
    {
77
        $this->parentDocument = $parent;
78
79
        return $this;
80
    }
81
82
    /**
83
     * Gets the parent document.
84
     *
85
     * @return object
86
     */
87
    public function getParentDocument()
88
    {
89
        return $this->parentDocument;
90
    }
91
92
    /**
93
     * Sets the document name.
94
     *
95
     * @param string $name
96
     */
97
    public function setName($name)
98
    {
99
        $this->name = $name;
100
101
        return $this;
102
    }
103
104
    /**
105
     * Gets the document name.
106
     *
107
     * @return string
108
     */
109
    public function getName()
110
    {
111
        return $this->name;
112
    }
113
114
    /**
115
     * @return string
116
     */
117
    public function getTitle()
118
    {
119
        return $this->title;
120
    }
121
122
    /**
123
     * @param string $title
124
     */
125
    public function setTitle($title)
126
    {
127
        $this->title = $title;
128
129
        return $this;
130
    }
131
132
    /**
133
     * @return string
134
     */
135
    public function getBody()
136
    {
137
        return $this->body;
0 ignored issues
show
Bug introduced by
The property body does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
138
    }
139
140
    /**
141
     * @param string $body
142
     */
143
    public function setBody($body)
144
    {
145
        $this->body = $body;
146
147
        return $this;
148
    }
149
}
150