Completed
Pull Request — master (#485)
by Maximilian
04:32
created

Content   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 125
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 10
lcom 0
cbo 0
dl 0
loc 125
rs 10
c 0
b 0
f 0

10 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 4 1
A getNode() 0 4 1
A setParentDocument() 0 6 1
A getParentDocument() 0 4 1
A setName() 0 6 1
A getName() 0 4 1
A getTitle() 0 4 1
A setTitle() 0 6 1
A getBody() 0 4 1
A setBody() 0 6 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
     * @return mixed
49
     */
50
    public function getId()
51
    {
52
        return $this->id;
53
    }
54
55
    /**
56
     * Gets the underlying PHPCR node of this content.
57
     *
58
     * @return NodeInterface
59
     */
60
    public function getNode()
61
    {
62
        return $this->node;
63
    }
64
65
    /**
66
     * Sets the parent document.
67
     *
68
     * @param object $parent the parent document
69
     */
70
    public function setParentDocument($parent)
71
    {
72
        $this->parentDocument = $parent;
73
74
        return $this;
75
    }
76
77
    /**
78
     * Gets the parent document.
79
     *
80
     * @return object
81
     */
82
    public function getParentDocument()
83
    {
84
        return $this->parentDocument;
85
    }
86
87
    /**
88
     * Sets the document name.
89
     *
90
     * @param string $name
91
     */
92
    public function setName($name)
93
    {
94
        $this->name = $name;
95
96
        return $this;
97
    }
98
99
    /**
100
     * Gets the document name.
101
     *
102
     * @return string
103
     */
104
    public function getName()
105
    {
106
        return $this->name;
107
    }
108
109
    /**
110
     * @return string
111
     */
112
    public function getTitle()
113
    {
114
        return $this->title;
115
    }
116
117
    /**
118
     * @param string $title
119
     */
120
    public function setTitle($title)
121
    {
122
        $this->title = $title;
123
124
        return $this;
125
    }
126
127
    /**
128
     * @return string
129
     */
130
    public function getBody()
131
    {
132
        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...
133
    }
134
135
    /**
136
     * @param string $body
137
     */
138
    public function setBody($body)
139
    {
140
        $this->body = $body;
141
142
        return $this;
143
    }
144
}
145