Completed
Push — master ( 428775...2db87f )
by Khoa
14:01
created
ext/vinabb/web/entities/bbook_book.php 2 patches
Indentation   +89 added lines, -89 removed lines patch added patch discarded remove patch
@@ -41,14 +41,14 @@  discard block
 block discarded – undo
41 41
 	protected $data;
42 42
 
43 43
 	/**
44
-	* Constructor
45
-	*
46
-	* @param \phpbb\db\driver\driver_interface				$db				Database object
47
-	* @param \phpbb\extension\manager						$ext_manager	Extension manager
48
-	* @param \vinabb\web\entities\helper\helper_interface	$entity_helper	Entity helper
49
-	* @param \phpbb\path_helper								$path_helper	Path helper
50
-	* @param string											$table_name		Table name
51
-	*/
44
+	 * Constructor
45
+	 *
46
+	 * @param \phpbb\db\driver\driver_interface				$db				Database object
47
+	 * @param \phpbb\extension\manager						$ext_manager	Extension manager
48
+	 * @param \vinabb\web\entities\helper\helper_interface	$entity_helper	Entity helper
49
+	 * @param \phpbb\path_helper								$path_helper	Path helper
50
+	 * @param string											$table_name		Table name
51
+	 */
52 52
 	public function __construct(
53 53
 		\phpbb\db\driver\driver_interface $db,
54 54
 		\phpbb\extension\manager $ext_manager,
@@ -68,10 +68,10 @@  discard block
 block discarded – undo
68 68
 	}
69 69
 
70 70
 	/**
71
-	* Data for this entity
72
-	*
73
-	* @return array
74
-	*/
71
+	 * Data for this entity
72
+	 *
73
+	 * @return array
74
+	 */
75 75
 	protected function prepare_data()
76 76
 	{
77 77
 		return [
@@ -90,12 +90,12 @@  discard block
 block discarded – undo
90 90
 	}
91 91
 
92 92
 	/**
93
-	* Load the data from the database for an entity
94
-	*
95
-	* @param int			$id		Book ID
96
-	* @return bbook_book	$this	Object for chaining calls: load()->set()->save()
97
-	* @throws \vinabb\web\exceptions\out_of_bounds
98
-	*/
93
+	 * Load the data from the database for an entity
94
+	 *
95
+	 * @param int			$id		Book ID
96
+	 * @return bbook_book	$this	Object for chaining calls: load()->set()->save()
97
+	 * @throws \vinabb\web\exceptions\out_of_bounds
98
+	 */
99 99
 	public function load($id)
100 100
 	{
101 101
 		$sql = 'SELECT *
@@ -115,16 +115,16 @@  discard block
 block discarded – undo
115 115
 	}
116 116
 
117 117
 	/**
118
-	* Import data for an entity
119
-	*
120
-	* Used when the data is already loaded externally.
121
-	* Any existing data on this entity is over-written.
122
-	* All data is validated and an exception is thrown if any data is invalid.
123
-	*
124
-	* @param array			$data	Data array from the database
125
-	* @return bbook_book	$this	Object for chaining calls: load()->set()->save()
126
-	* @throws \vinabb\web\exceptions\invalid_argument
127
-	*/
118
+	 * Import data for an entity
119
+	 *
120
+	 * Used when the data is already loaded externally.
121
+	 * Any existing data on this entity is over-written.
122
+	 * All data is validated and an exception is thrown if any data is invalid.
123
+	 *
124
+	 * @param array			$data	Data array from the database
125
+	 * @return bbook_book	$this	Object for chaining calls: load()->set()->save()
126
+	 * @throws \vinabb\web\exceptions\invalid_argument
127
+	 */
128 128
 	public function import($data)
129 129
 	{
130 130
 		// Clear out any saved data
@@ -152,13 +152,13 @@  discard block
 block discarded – undo
152 152
 	}
153 153
 
154 154
 	/**
155
-	* Insert the entity for the first time
156
-	*
157
-	* Will throw an exception if the entity was already inserted (call save() instead)
158
-	*
159
-	* @return bbook_book $this Object for chaining calls: load()->set()->save()
160
-	* @throws \vinabb\web\exceptions\out_of_bounds
161
-	*/
155
+	 * Insert the entity for the first time
156
+	 *
157
+	 * Will throw an exception if the entity was already inserted (call save() instead)
158
+	 *
159
+	 * @return bbook_book $this Object for chaining calls: load()->set()->save()
160
+	 * @throws \vinabb\web\exceptions\out_of_bounds
161
+	 */
162 162
 	public function insert()
163 163
 	{
164 164
 		// The entity already exists
@@ -180,14 +180,14 @@  discard block
 block discarded – undo
180 180
 	}
181 181
 
182 182
 	/**
183
-	* Save the current settings to the database
184
-	*
185
-	* This must be called before closing or any changes will not be saved!
186
-	* If adding an entity (saving for the first time), you must call insert() or an exception will be thrown
187
-	*
188
-	* @return bbook_book $this Object for chaining calls: load()->set()->save()
189
-	* @throws \vinabb\web\exceptions\out_of_bounds
190
-	*/
183
+	 * Save the current settings to the database
184
+	 *
185
+	 * This must be called before closing or any changes will not be saved!
186
+	 * If adding an entity (saving for the first time), you must call insert() or an exception will be thrown
187
+	 *
188
+	 * @return bbook_book $this Object for chaining calls: load()->set()->save()
189
+	 * @throws \vinabb\web\exceptions\out_of_bounds
190
+	 */
191 191
 	public function save()
192 192
 	{
193 193
 		// The entity does not exist
@@ -209,32 +209,32 @@  discard block
 block discarded – undo
209 209
 	}
210 210
 
211 211
 	/**
212
-	* Get the book ID
213
-	*
214
-	* @return int
215
-	*/
212
+	 * Get the book ID
213
+	 *
214
+	 * @return int
215
+	 */
216 216
 	public function get_id()
217 217
 	{
218 218
 		return isset($this->data['book_id']) ? (int) $this->data['book_id'] : 0;
219 219
 	}
220 220
 
221 221
 	/**
222
-	* Get the book title
223
-	*
224
-	* @return string
225
-	*/
222
+	 * Get the book title
223
+	 *
224
+	 * @return string
225
+	 */
226 226
 	public function get_name()
227 227
 	{
228 228
 		return isset($this->data['book_name']) ? (string) $this->data['book_name'] : '';
229 229
 	}
230 230
 
231 231
 	/**
232
-	* Set the book title
233
-	*
234
-	* @param string			$text	Book title
235
-	* @return bbook_book	$this	Object for chaining calls: load()->set()->save()
236
-	* @throws \vinabb\web\exceptions\unexpected_value
237
-	*/
232
+	 * Set the book title
233
+	 *
234
+	 * @param string			$text	Book title
235
+	 * @return bbook_book	$this	Object for chaining calls: load()->set()->save()
236
+	 * @throws \vinabb\web\exceptions\unexpected_value
237
+	 */
238 238
 	public function set_name($text)
239 239
 	{
240 240
 		$text = (string) $text;
@@ -258,22 +258,22 @@  discard block
 block discarded – undo
258 258
 	}
259 259
 
260 260
 	/**
261
-	* Get the book SEO title
262
-	*
263
-	* @return string
264
-	*/
261
+	 * Get the book SEO title
262
+	 *
263
+	 * @return string
264
+	 */
265 265
 	public function get_name_seo()
266 266
 	{
267 267
 		return isset($this->data['book_name_seo']) ? (string) $this->data['book_name_seo'] : '';
268 268
 	}
269 269
 
270 270
 	/**
271
-	* Set the book SEO title
272
-	*
273
-	* @param string			$text	Book SEO title
274
-	* @return bbook_book	$this	Object for chaining calls: load()->set()->save()
275
-	* @throws \vinabb\web\exceptions\unexpected_value
276
-	*/
271
+	 * Set the book SEO title
272
+	 *
273
+	 * @param string			$text	Book SEO title
274
+	 * @return bbook_book	$this	Object for chaining calls: load()->set()->save()
275
+	 * @throws \vinabb\web\exceptions\unexpected_value
276
+	 */
277 277
 	public function set_name_seo($text)
278 278
 	{
279 279
 		$text = (string) $text;
@@ -291,22 +291,22 @@  discard block
 block discarded – undo
291 291
 	}
292 292
 
293 293
 	/**
294
-	* Get the book language
295
-	*
296
-	* @return string
297
-	*/
294
+	 * Get the book language
295
+	 *
296
+	 * @return string
297
+	 */
298 298
 	public function get_lang()
299 299
 	{
300 300
 		return isset($this->data['book_lang']) ? (string) $this->data['book_lang'] : '';
301 301
 	}
302 302
 
303 303
 	/**
304
-	* Set the book language
305
-	*
306
-	* @param string			$text	2-letter language ISO code
307
-	* @return bbook_book	$this	Object for chaining calls: load()->set()->save()
308
-	* @throws \vinabb\web\exceptions\unexpected_value
309
-	*/
304
+	 * Set the book language
305
+	 *
306
+	 * @param string			$text	2-letter language ISO code
307
+	 * @return bbook_book	$this	Object for chaining calls: load()->set()->save()
308
+	 * @throws \vinabb\web\exceptions\unexpected_value
309
+	 */
310 310
 	public function set_lang($text)
311 311
 	{
312 312
 		$text = (string) $text;
@@ -328,12 +328,12 @@  discard block
 block discarded – undo
328 328
 	}
329 329
 
330 330
 	/**
331
-	* Get the book cover
332
-	*
333
-	* @param bool	$real_path	True to return the path on filesystem, false to return the web access path
334
-	* @param bool	$full_path	True to return the path + filename, false to return only filename
335
-	* @return string
336
-	*/
331
+	 * Get the book cover
332
+	 *
333
+	 * @param bool	$real_path	True to return the path on filesystem, false to return the web access path
334
+	 * @param bool	$full_path	True to return the path + filename, false to return only filename
335
+	 * @return string
336
+	 */
337 337
 	public function get_img($real_path = false, $full_path = true)
338 338
 	{
339 339
 		$path = $full_path ? ($real_path ? $this->ext_root_path : $this->ext_web_path) . constants::DIR_BBOOK_FILES . 'cover_images/' : '';
@@ -342,12 +342,12 @@  discard block
 block discarded – undo
342 342
 	}
343 343
 
344 344
 	/**
345
-	* Set the book cover
346
-	*
347
-	* @param string			$text	Book cover image
348
-	* @return bbook_book	$this	Object for chaining calls: load()->set()->save()
349
-	* @throws \vinabb\web\exceptions\unexpected_value
350
-	*/
345
+	 * Set the book cover
346
+	 *
347
+	 * @param string			$text	Book cover image
348
+	 * @return bbook_book	$this	Object for chaining calls: load()->set()->save()
349
+	 * @throws \vinabb\web\exceptions\unexpected_value
350
+	 */
351 351
 	public function set_img($text)
352 352
 	{
353 353
 		$text = (string) $text;
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,8 +55,7 @@
 block discarded – undo
55 55
 		\vinabb\web\entities\helper\helper_interface $entity_helper,
56 56
 		\phpbb\path_helper $path_helper,
57 57
 		$table_name
58
-	)
59
-	{
58
+	) {
60 59
 		$this->db = $db;
61 60
 		$this->ext_manager = $ext_manager;
62 61
 		$this->entity_helper = $entity_helper;
Please login to merge, or discard this patch.
ext/vinabb/web/entities/bbook_book_interface.php 1 patch
Indentation   +122 added lines, -122 removed lines patch added patch discarded remove patch
@@ -14,190 +14,190 @@
 block discarded – undo
14 14
 interface bbook_book_interface
15 15
 {
16 16
 	/**
17
-	* Load the data from the database for an entity
18
-	*
19
-	* @param int					$id		Book ID
20
-	* @return bbook_book_interface	$this	Object for chaining calls: load()->set()->save()
21
-	* @throws \vinabb\web\exceptions\out_of_bounds
22
-	*/
17
+	 * Load the data from the database for an entity
18
+	 *
19
+	 * @param int					$id		Book ID
20
+	 * @return bbook_book_interface	$this	Object for chaining calls: load()->set()->save()
21
+	 * @throws \vinabb\web\exceptions\out_of_bounds
22
+	 */
23 23
 	public function load($id);
24 24
 
25 25
 	/**
26
-	* Import data for an entity
27
-	*
28
-	* Used when the data is already loaded externally.
29
-	* Any existing data on this entity is over-written.
30
-	* All data is validated and an exception is thrown if any data is invalid.
31
-	*
32
-	* @param array					$data	Data array from the database
33
-	* @return bbook_book_interface	$this	Object for chaining calls: load()->set()->save()
34
-	* @throws \vinabb\web\exceptions\invalid_argument
35
-	*/
26
+	 * Import data for an entity
27
+	 *
28
+	 * Used when the data is already loaded externally.
29
+	 * Any existing data on this entity is over-written.
30
+	 * All data is validated and an exception is thrown if any data is invalid.
31
+	 *
32
+	 * @param array					$data	Data array from the database
33
+	 * @return bbook_book_interface	$this	Object for chaining calls: load()->set()->save()
34
+	 * @throws \vinabb\web\exceptions\invalid_argument
35
+	 */
36 36
 	public function import($data);
37 37
 
38 38
 	/**
39
-	* Insert the entity for the first time
40
-	*
41
-	* Will throw an exception if the entity was already inserted (call save() instead)
42
-	*
43
-	* @return bbook_book_interface $this Object for chaining calls: load()->set()->save()
44
-	* @throws \vinabb\web\exceptions\out_of_bounds
45
-	*/
39
+	 * Insert the entity for the first time
40
+	 *
41
+	 * Will throw an exception if the entity was already inserted (call save() instead)
42
+	 *
43
+	 * @return bbook_book_interface $this Object for chaining calls: load()->set()->save()
44
+	 * @throws \vinabb\web\exceptions\out_of_bounds
45
+	 */
46 46
 	public function insert();
47 47
 
48 48
 	/**
49
-	* Save the current settings to the database
50
-	*
51
-	* This must be called before closing or any changes will not be saved!
52
-	* If adding an entity (saving for the first time), you must call insert() or an exception will be thrown
53
-	*
54
-	* @return bbook_book_interface $this Object for chaining calls: load()->set()->save()
55
-	* @throws \vinabb\web\exceptions\out_of_bounds
56
-	*/
49
+	 * Save the current settings to the database
50
+	 *
51
+	 * This must be called before closing or any changes will not be saved!
52
+	 * If adding an entity (saving for the first time), you must call insert() or an exception will be thrown
53
+	 *
54
+	 * @return bbook_book_interface $this Object for chaining calls: load()->set()->save()
55
+	 * @throws \vinabb\web\exceptions\out_of_bounds
56
+	 */
57 57
 	public function save();
58 58
 
59 59
 	/**
60
-	* Get the book ID
61
-	*
62
-	* @return int
63
-	*/
60
+	 * Get the book ID
61
+	 *
62
+	 * @return int
63
+	 */
64 64
 	public function get_id();
65 65
 
66 66
 	/**
67
-	* Get the book title
68
-	*
69
-	* @return string
70
-	*/
67
+	 * Get the book title
68
+	 *
69
+	 * @return string
70
+	 */
71 71
 	public function get_name();
72 72
 
73 73
 	/**
74
-	* Set the book title
75
-	*
76
-	* @param string					$text	Book title
77
-	* @return bbook_book_interface	$this	Object for chaining calls: load()->set()->save()
78
-	* @throws \vinabb\web\exceptions\unexpected_value
79
-	*/
74
+	 * Set the book title
75
+	 *
76
+	 * @param string					$text	Book title
77
+	 * @return bbook_book_interface	$this	Object for chaining calls: load()->set()->save()
78
+	 * @throws \vinabb\web\exceptions\unexpected_value
79
+	 */
80 80
 	public function set_name($text);
81 81
 
82 82
 	/**
83
-	* Get the book SEO title
84
-	*
85
-	* @return string
86
-	*/
83
+	 * Get the book SEO title
84
+	 *
85
+	 * @return string
86
+	 */
87 87
 	public function get_name_seo();
88 88
 
89 89
 	/**
90
-	* Set the book SEO title
91
-	*
92
-	* @param string					$text	Book SEO title
93
-	* @return bbook_book_interface	$this	Object for chaining calls: load()->set()->save()
94
-	* @throws \vinabb\web\exceptions\unexpected_value
95
-	*/
90
+	 * Set the book SEO title
91
+	 *
92
+	 * @param string					$text	Book SEO title
93
+	 * @return bbook_book_interface	$this	Object for chaining calls: load()->set()->save()
94
+	 * @throws \vinabb\web\exceptions\unexpected_value
95
+	 */
96 96
 	public function set_name_seo($text);
97 97
 
98 98
 	/**
99
-	* Get the book language
100
-	*
101
-	* @return string
102
-	*/
99
+	 * Get the book language
100
+	 *
101
+	 * @return string
102
+	 */
103 103
 	public function get_lang();
104 104
 
105 105
 	/**
106
-	* Set the book language
107
-	*
108
-	* @param string					$text	2-letter language ISO code
109
-	* @return bbook_book_interface	$this	Object for chaining calls: load()->set()->save()
110
-	* @throws \vinabb\web\exceptions\unexpected_value
111
-	*/
106
+	 * Set the book language
107
+	 *
108
+	 * @param string					$text	2-letter language ISO code
109
+	 * @return bbook_book_interface	$this	Object for chaining calls: load()->set()->save()
110
+	 * @throws \vinabb\web\exceptions\unexpected_value
111
+	 */
112 112
 	public function set_lang($text);
113 113
 
114 114
 	/**
115
-	* Get the book cover
116
-	*
117
-	* @param bool	$real_path	True to return the path on filesystem, false to return the web access path
118
-	* @param bool	$full_path	True to return the path + filename, false to return only filename
119
-	* @return string
120
-	*/
115
+	 * Get the book cover
116
+	 *
117
+	 * @param bool	$real_path	True to return the path on filesystem, false to return the web access path
118
+	 * @param bool	$full_path	True to return the path + filename, false to return only filename
119
+	 * @return string
120
+	 */
121 121
 	public function get_img($real_path = false, $full_path = true);
122 122
 
123 123
 	/**
124
-	* Set the book cover
125
-	*
126
-	* @param string					$text	Book cover image
127
-	* @return bbook_book_interface	$this	Object for chaining calls: load()->set()->save()
128
-	* @throws \vinabb\web\exceptions\unexpected_value
129
-	*/
124
+	 * Set the book cover
125
+	 *
126
+	 * @param string					$text	Book cover image
127
+	 * @return bbook_book_interface	$this	Object for chaining calls: load()->set()->save()
128
+	 * @throws \vinabb\web\exceptions\unexpected_value
129
+	 */
130 130
 	public function set_img($text);
131 131
 
132 132
 	/**
133
-	* Get book description for edit
134
-	*
135
-	* @return string
136
-	*/
133
+	 * Get book description for edit
134
+	 *
135
+	 * @return string
136
+	 */
137 137
 	public function get_text_for_edit();
138 138
 
139 139
 	/**
140
-	* Get book description for display
141
-	*
142
-	* @param bool $censor True to censor the text
143
-	* @return string
144
-	*/
140
+	 * Get book description for display
141
+	 *
142
+	 * @param bool $censor True to censor the text
143
+	 * @return string
144
+	 */
145 145
 	public function get_text_for_display($censor = true);
146 146
 
147 147
 	/**
148
-	* Set book description
149
-	*
150
-	* @param string					$text	Book description
151
-	* @return bbook_book_interface	$this	Object for chaining calls: load()->set()->save()
152
-	* @throws \vinabb\web\exceptions\unexpected_value
153
-	*/
148
+	 * Set book description
149
+	 *
150
+	 * @param string					$text	Book description
151
+	 * @return bbook_book_interface	$this	Object for chaining calls: load()->set()->save()
152
+	 * @throws \vinabb\web\exceptions\unexpected_value
153
+	 */
154 154
 	public function set_text($text);
155 155
 
156 156
 	/**
157
-	* Check if BBCode is enabled on the book description
158
-	*
159
-	* @return bool
160
-	*/
157
+	 * Check if BBCode is enabled on the book description
158
+	 *
159
+	 * @return bool
160
+	 */
161 161
 	public function text_bbcode_enabled();
162 162
 
163 163
 	/**
164
-	* Enable/Disable BBCode on the book description
165
-	* This should be called before set_text(); text_enable_bbcode()->set_text()
166
-	*
167
-	* @param bool					$enable	true: enable; false: disable
168
-	* @return bbook_book_interface	$this	Object for chaining calls: load()->set()->save()
169
-	*/
164
+	 * Enable/Disable BBCode on the book description
165
+	 * This should be called before set_text(); text_enable_bbcode()->set_text()
166
+	 *
167
+	 * @param bool					$enable	true: enable; false: disable
168
+	 * @return bbook_book_interface	$this	Object for chaining calls: load()->set()->save()
169
+	 */
170 170
 	public function text_enable_bbcode($enable);
171 171
 
172 172
 	/**
173
-	* Check if URLs is enabled on the book description
174
-	*
175
-	* @return bool
176
-	*/
173
+	 * Check if URLs is enabled on the book description
174
+	 *
175
+	 * @return bool
176
+	 */
177 177
 	public function text_urls_enabled();
178 178
 
179 179
 	/**
180
-	* Enable/Disable URLs on the book description
181
-	* This should be called before set_text(); text_enable_urls()->set_text()
182
-	*
183
-	* @param bool					$enable	true: enable; false: disable
184
-	* @return bbook_book_interface	$this	Object for chaining calls: load()->set()->save()
185
-	*/
180
+	 * Enable/Disable URLs on the book description
181
+	 * This should be called before set_text(); text_enable_urls()->set_text()
182
+	 *
183
+	 * @param bool					$enable	true: enable; false: disable
184
+	 * @return bbook_book_interface	$this	Object for chaining calls: load()->set()->save()
185
+	 */
186 186
 	public function text_enable_urls($enable);
187 187
 
188 188
 	/**
189
-	* Check if smilies are enabled on the book description
190
-	*
191
-	* @return bool
192
-	*/
189
+	 * Check if smilies are enabled on the book description
190
+	 *
191
+	 * @return bool
192
+	 */
193 193
 	public function text_smilies_enabled();
194 194
 
195 195
 	/**
196
-	* Enable/Disable smilies on the book description
197
-	* This should be called before set_text(); text_enable_smilies()->set_text()
198
-	*
199
-	* @param bool					$enable	true: enable; false: disable
200
-	* @return bbook_book_interface	$this	Object for chaining calls: load()->set()->save()
201
-	*/
196
+	 * Enable/Disable smilies on the book description
197
+	 * This should be called before set_text(); text_enable_smilies()->set_text()
198
+	 *
199
+	 * @param bool					$enable	true: enable; false: disable
200
+	 * @return bbook_book_interface	$this	Object for chaining calls: load()->set()->save()
201
+	 */
202 202
 	public function text_enable_smilies($enable);
203 203
 }
Please login to merge, or discard this patch.