1 | <?php |
||
16 | class ContentItem extends Document implements \JsonSerializable, TwigDocumentInterface |
||
17 | { |
||
18 | /** |
||
19 | * The collection this Content Item belongs to. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | private $parentCollection; |
||
24 | |||
25 | /** |
||
26 | * The Page View that will be used to render this Content Item. |
||
27 | * |
||
28 | * @var PageView |
||
29 | */ |
||
30 | private $parentPageView; |
||
31 | |||
32 | /** |
||
33 | * {@inheritdoc} |
||
34 | */ |
||
35 | 27 | public function createJail() |
|
41 | |||
42 | 21 | public function getNamespace() |
|
43 | { |
||
44 | 21 | return $this->parentCollection; |
|
45 | } |
||
46 | |||
47 | 37 | public function setNamespace($collection) |
|
48 | { |
||
49 | 37 | $this->parentCollection = $collection; |
|
50 | 37 | } |
|
51 | |||
52 | /** |
||
53 | * Return the body of the Content Item parsed as markdown. |
||
54 | * |
||
55 | * @return string |
||
56 | */ |
||
57 | 7 | public function getContent() |
|
69 | |||
70 | /** |
||
71 | * Parse the Twig that is embedded inside a ContentItem's body. |
||
72 | */ |
||
73 | 7 | private function parseTwig() |
|
83 | |||
84 | /** |
||
85 | * Parse the ContentItem's body based on the extension of the file. |
||
86 | */ |
||
87 | 7 | private function parseEngines() |
|
108 | |||
109 | /** |
||
110 | * Check whether a ContentItem should be treated as a draft |
||
111 | * |
||
112 | * @return bool |
||
113 | */ |
||
114 | 3 | public function isDraft() |
|
115 | { |
||
116 | 3 | return ($this['draft'] === true); |
|
117 | } |
||
118 | |||
119 | /** |
||
120 | * @return PageView |
||
121 | */ |
||
122 | public function &getPageView() |
||
126 | |||
127 | public function getJailedPageView() |
||
131 | |||
132 | /** |
||
133 | * Set the parent Page View that this Content Item will have be assigned to. |
||
134 | * |
||
135 | * @param PageView $pageView |
||
136 | */ |
||
137 | 5 | public function setPageView(&$pageView) |
|
141 | |||
142 | /** |
||
143 | * {@inheritdoc} |
||
144 | */ |
||
145 | public function jsonSerialize() |
||
153 | } |
||
154 |
Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.