@@ -124,7 +124,7 @@ |
||
124 | 124 | /** |
125 | 125 | * Increment clicks for specified ad |
126 | 126 | * |
127 | - * @param array $ad_id ID of an ad to increment clicks |
|
127 | + * @param integer $ad_id ID of an ad to increment clicks |
|
128 | 128 | * @return void |
129 | 129 | */ |
130 | 130 | public function increment_ad_clicks($ad_id) |
@@ -22,12 +22,12 @@ discard block |
||
22 | 22 | protected $ad_locations_table; |
23 | 23 | |
24 | 24 | /** |
25 | - * Constructor |
|
26 | - * |
|
27 | - * @param \phpbb\db\driver\driver_interface $db DB driver interface |
|
28 | - * @param string $ads_table Ads table |
|
29 | - * @param string $ad_locations_table Ad locations table |
|
30 | - */ |
|
25 | + * Constructor |
|
26 | + * |
|
27 | + * @param \phpbb\db\driver\driver_interface $db DB driver interface |
|
28 | + * @param string $ads_table Ads table |
|
29 | + * @param string $ad_locations_table Ad locations table |
|
30 | + */ |
|
31 | 31 | public function __construct(\phpbb\db\driver\driver_interface $db, $ads_table, $ad_locations_table) |
32 | 32 | { |
33 | 33 | $this->db = $db; |
@@ -36,11 +36,11 @@ discard block |
||
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
39 | - * Get specific ad |
|
40 | - * |
|
41 | - * @param int $ad_id Advertisement ID |
|
42 | - * @return mixed Array with advertisement data, false if ad doesn't exist |
|
43 | - */ |
|
39 | + * Get specific ad |
|
40 | + * |
|
41 | + * @param int $ad_id Advertisement ID |
|
42 | + * @return mixed Array with advertisement data, false if ad doesn't exist |
|
43 | + */ |
|
44 | 44 | public function get_ad($ad_id) |
45 | 45 | { |
46 | 46 | $sql = 'SELECT * |
@@ -54,11 +54,11 @@ discard block |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
57 | - * Get one ad per every location |
|
58 | - * |
|
59 | - * @param array $ad_locations List of ad locations to fetch ads for |
|
60 | - * @return array List of ad codes for each location |
|
61 | - */ |
|
57 | + * Get one ad per every location |
|
58 | + * |
|
59 | + * @param array $ad_locations List of ad locations to fetch ads for |
|
60 | + * @return array List of ad codes for each location |
|
61 | + */ |
|
62 | 62 | public function get_ads($ad_locations) |
63 | 63 | { |
64 | 64 | $sql = 'SELECT location_id, ad_id, ad_code |
@@ -86,10 +86,10 @@ discard block |
||
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
89 | - * Get all advertisements |
|
90 | - * |
|
91 | - * @return array List of all ads |
|
92 | - */ |
|
89 | + * Get all advertisements |
|
90 | + * |
|
91 | + * @return array List of all ads |
|
92 | + */ |
|
93 | 93 | public function get_all_ads() |
94 | 94 | { |
95 | 95 | $sql = 'SELECT ad_id, ad_name, ad_enabled, ad_end_date, ad_views, ad_clicks, ad_views_limit, ad_clicks_limit |
@@ -102,14 +102,14 @@ discard block |
||
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
105 | - * Increment views for specified ads |
|
106 | - * |
|
107 | - * Note, that views are incremented only by one even when |
|
108 | - * an ad is displayed multiple times on the same page. |
|
109 | - * |
|
110 | - * @param array $ad_ids IDs of ads to increment views |
|
111 | - * @return void |
|
112 | - */ |
|
105 | + * Increment views for specified ads |
|
106 | + * |
|
107 | + * Note, that views are incremented only by one even when |
|
108 | + * an ad is displayed multiple times on the same page. |
|
109 | + * |
|
110 | + * @param array $ad_ids IDs of ads to increment views |
|
111 | + * @return void |
|
112 | + */ |
|
113 | 113 | public function increment_ads_views($ad_ids) |
114 | 114 | { |
115 | 115 | if (!empty($ad_ids)) |
@@ -122,11 +122,11 @@ discard block |
||
122 | 122 | } |
123 | 123 | |
124 | 124 | /** |
125 | - * Increment clicks for specified ad |
|
126 | - * |
|
127 | - * @param array $ad_id ID of an ad to increment clicks |
|
128 | - * @return void |
|
129 | - */ |
|
125 | + * Increment clicks for specified ad |
|
126 | + * |
|
127 | + * @param array $ad_id ID of an ad to increment clicks |
|
128 | + * @return void |
|
129 | + */ |
|
130 | 130 | public function increment_ad_clicks($ad_id) |
131 | 131 | { |
132 | 132 | $sql = 'UPDATE ' . $this->ads_table . ' |
@@ -136,11 +136,11 @@ discard block |
||
136 | 136 | } |
137 | 137 | |
138 | 138 | /** |
139 | - * Insert new advertisement to the database |
|
140 | - * |
|
141 | - * @param array $data New ad data |
|
142 | - * @return int New advertisement ID |
|
143 | - */ |
|
139 | + * Insert new advertisement to the database |
|
140 | + * |
|
141 | + * @param array $data New ad data |
|
142 | + * @return int New advertisement ID |
|
143 | + */ |
|
144 | 144 | public function insert_ad($data) |
145 | 145 | { |
146 | 146 | $data = $this->intersect_ad_data($data); |
@@ -152,12 +152,12 @@ discard block |
||
152 | 152 | } |
153 | 153 | |
154 | 154 | /** |
155 | - * Update advertisement |
|
156 | - * |
|
157 | - * @param int $ad_id Advertisement ID |
|
158 | - * @param array $data List of data to update in the database |
|
159 | - * @return int Number of affected rows. Can be used to determine if any ad has been updated. |
|
160 | - */ |
|
155 | + * Update advertisement |
|
156 | + * |
|
157 | + * @param int $ad_id Advertisement ID |
|
158 | + * @param array $data List of data to update in the database |
|
159 | + * @return int Number of affected rows. Can be used to determine if any ad has been updated. |
|
160 | + */ |
|
161 | 161 | public function update_ad($ad_id, $data) |
162 | 162 | { |
163 | 163 | $data = $this->intersect_ad_data($data); |
@@ -171,11 +171,11 @@ discard block |
||
171 | 171 | } |
172 | 172 | |
173 | 173 | /** |
174 | - * Delete advertisement |
|
175 | - * |
|
176 | - * @param int $ad_id Advertisement ID |
|
177 | - * @return int Number of affected rows. Can be used to determine if any ad has been deleted. |
|
178 | - */ |
|
174 | + * Delete advertisement |
|
175 | + * |
|
176 | + * @param int $ad_id Advertisement ID |
|
177 | + * @return int Number of affected rows. Can be used to determine if any ad has been deleted. |
|
178 | + */ |
|
179 | 179 | public function delete_ad($ad_id) |
180 | 180 | { |
181 | 181 | $sql = 'DELETE FROM ' . $this->ads_table . ' |
@@ -186,11 +186,11 @@ discard block |
||
186 | 186 | } |
187 | 187 | |
188 | 188 | /** |
189 | - * Get all locations for specified advertisement |
|
190 | - * |
|
191 | - * @param int $ad_id Advertisement ID |
|
192 | - * @return array List of template locations for specified ad |
|
193 | - */ |
|
189 | + * Get all locations for specified advertisement |
|
190 | + * |
|
191 | + * @param int $ad_id Advertisement ID |
|
192 | + * @return array List of template locations for specified ad |
|
193 | + */ |
|
194 | 194 | public function get_ad_locations($ad_id) |
195 | 195 | { |
196 | 196 | $ad_locations = array(); |
@@ -209,12 +209,12 @@ discard block |
||
209 | 209 | } |
210 | 210 | |
211 | 211 | /** |
212 | - * Insert advertisement locations |
|
213 | - * |
|
214 | - * @param int $ad_id Advertisement ID |
|
215 | - * @param array $ad_locations List of template locations for this ad |
|
216 | - * @return void |
|
217 | - */ |
|
212 | + * Insert advertisement locations |
|
213 | + * |
|
214 | + * @param int $ad_id Advertisement ID |
|
215 | + * @param array $ad_locations List of template locations for this ad |
|
216 | + * @return void |
|
217 | + */ |
|
218 | 218 | public function insert_ad_locations($ad_id, $ad_locations) |
219 | 219 | { |
220 | 220 | $sql_ary = array(); |
@@ -229,11 +229,11 @@ discard block |
||
229 | 229 | } |
230 | 230 | |
231 | 231 | /** |
232 | - * Delete advertisement locations |
|
233 | - * |
|
234 | - * @param int $ad_id Advertisement ID |
|
235 | - * @return void |
|
236 | - */ |
|
232 | + * Delete advertisement locations |
|
233 | + * |
|
234 | + * @param int $ad_id Advertisement ID |
|
235 | + * @return void |
|
236 | + */ |
|
237 | 237 | public function delete_ad_locations($ad_id) |
238 | 238 | { |
239 | 239 | $sql = 'DELETE FROM ' . $this->ad_locations_table . ' |
@@ -242,11 +242,11 @@ discard block |
||
242 | 242 | } |
243 | 243 | |
244 | 244 | /** |
245 | - * Load memberships of the user |
|
246 | - * |
|
247 | - * @param int $user_id User ID to load memberships |
|
248 | - * @return array List of group IDs user is member of |
|
249 | - */ |
|
245 | + * Load memberships of the user |
|
246 | + * |
|
247 | + * @param int $user_id User ID to load memberships |
|
248 | + * @return array List of group IDs user is member of |
|
249 | + */ |
|
250 | 250 | public function load_memberships($user_id) |
251 | 251 | { |
252 | 252 | $memberships = array(); |
@@ -264,10 +264,10 @@ discard block |
||
264 | 264 | } |
265 | 265 | |
266 | 266 | /** |
267 | - * Load all board groups |
|
268 | - * |
|
269 | - * @return array List of groups |
|
270 | - */ |
|
267 | + * Load all board groups |
|
268 | + * |
|
269 | + * @return array List of groups |
|
270 | + */ |
|
271 | 271 | public function load_groups() |
272 | 272 | { |
273 | 273 | $sql = 'SELECT group_id, group_name, group_type |
@@ -281,11 +281,11 @@ discard block |
||
281 | 281 | } |
282 | 282 | |
283 | 283 | /** |
284 | - * Make sure only necessary data make their way to SQL query |
|
285 | - * |
|
286 | - * @param array $data List of data to query the database |
|
287 | - * @return array Cleaned data that contain only valid keys |
|
288 | - */ |
|
284 | + * Make sure only necessary data make their way to SQL query |
|
285 | + * |
|
286 | + * @param array $data List of data to query the database |
|
287 | + * @return array Cleaned data that contain only valid keys |
|
288 | + */ |
|
289 | 289 | protected function intersect_ad_data($data) |
290 | 290 | { |
291 | 291 | return array_intersect_key($data, array( |
@@ -301,11 +301,11 @@ discard block |
||
301 | 301 | } |
302 | 302 | |
303 | 303 | /** |
304 | - * Get the random statement for this database layer |
|
305 | - * Random function should generate a float value between 0 and 1 |
|
306 | - * |
|
307 | - * @return string Random statement for current database layer |
|
308 | - */ |
|
304 | + * Get the random statement for this database layer |
|
305 | + * Random function should generate a float value between 0 and 1 |
|
306 | + * |
|
307 | + * @return string Random statement for current database layer |
|
308 | + */ |
|
309 | 309 | protected function sql_random() |
310 | 310 | { |
311 | 311 | switch ($this->db->get_sql_layer()) |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | protected $controller_helper; |
43 | 43 | |
44 | 44 | /** |
45 | - * {@inheritdoc} |
|
46 | - */ |
|
45 | + * {@inheritdoc} |
|
46 | + */ |
|
47 | 47 | static public function getSubscribedEvents() |
48 | 48 | { |
49 | 49 | return array( |
@@ -53,16 +53,16 @@ discard block |
||
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
56 | - * Constructor |
|
57 | - * |
|
58 | - * @param \phpbb\template\template $template Template object |
|
59 | - * @param \phpbb\user $user User object |
|
60 | - * @param \phpbb\config\db_text $config_text Config text object |
|
61 | - * @param \phpbb\config\config $config Config object |
|
62 | - * @param \phpbb\ads\ad\manager $manager Advertisement manager object |
|
63 | - * @param \phpbb\ads\location\manager $location_manager Template location manager object |
|
64 | - * @param \phpbb\controller\helper $controller_helper Controller helper object |
|
65 | - */ |
|
56 | + * Constructor |
|
57 | + * |
|
58 | + * @param \phpbb\template\template $template Template object |
|
59 | + * @param \phpbb\user $user User object |
|
60 | + * @param \phpbb\config\db_text $config_text Config text object |
|
61 | + * @param \phpbb\config\config $config Config object |
|
62 | + * @param \phpbb\ads\ad\manager $manager Advertisement manager object |
|
63 | + * @param \phpbb\ads\location\manager $location_manager Template location manager object |
|
64 | + * @param \phpbb\controller\helper $controller_helper Controller helper object |
|
65 | + */ |
|
66 | 66 | public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\config\db_text $config_text, \phpbb\config\config $config, \phpbb\ads\ad\manager $manager, \phpbb\ads\location\manager $location_manager, \phpbb\controller\helper $controller_helper) |
67 | 67 | { |
68 | 68 | $this->template = $template; |
@@ -75,11 +75,11 @@ discard block |
||
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
78 | - * Load common language file during user setup |
|
79 | - * |
|
80 | - * @param \phpbb\event\data $event The event object |
|
81 | - * @return void |
|
82 | - */ |
|
78 | + * Load common language file during user setup |
|
79 | + * |
|
80 | + * @param \phpbb\event\data $event The event object |
|
81 | + * @return void |
|
82 | + */ |
|
83 | 83 | public function load_language_on_setup($event) |
84 | 84 | { |
85 | 85 | $lang_set_ext = $event['lang_set_ext']; |
@@ -22,11 +22,11 @@ discard block |
||
22 | 22 | protected $helper; |
23 | 23 | |
24 | 24 | /** |
25 | - * Constructor |
|
26 | - * |
|
27 | - * @param \phpbb\ads\ad\manager $manager Advertisement manager object |
|
28 | - * @param \phpbb\controller\helper $helper Controller helper object |
|
29 | - */ |
|
25 | + * Constructor |
|
26 | + * |
|
27 | + * @param \phpbb\ads\ad\manager $manager Advertisement manager object |
|
28 | + * @param \phpbb\controller\helper $helper Controller helper object |
|
29 | + */ |
|
30 | 30 | public function __construct(\phpbb\ads\ad\manager $manager, \phpbb\controller\helper $helper) |
31 | 31 | { |
32 | 32 | $this->manager = $manager; |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
37 | - * Increment clicks for an ad |
|
38 | - * |
|
39 | - * @param int $ad_id Advertisement ID |
|
40 | - * @return void |
|
41 | - */ |
|
37 | + * Increment clicks for an ad |
|
38 | + * |
|
39 | + * @param int $ad_id Advertisement ID |
|
40 | + * @return void |
|
41 | + */ |
|
42 | 42 | public function increment_clicks($ad_id) |
43 | 43 | { |
44 | 44 | $this->manager->increment_ad_clicks($ad_id); |
@@ -13,27 +13,27 @@ discard block |
||
13 | 13 | class m9_views_clicks extends \phpbb\db\migration\migration |
14 | 14 | { |
15 | 15 | /** |
16 | - * {@inheritDoc} |
|
17 | - */ |
|
16 | + * {@inheritDoc} |
|
17 | + */ |
|
18 | 18 | public function effectively_installed() |
19 | 19 | { |
20 | 20 | return $this->db_tools->sql_column_exists($this->table_prefix . 'ads', 'ad_views'); |
21 | 21 | } |
22 | 22 | |
23 | 23 | /** |
24 | - * {@inheritDoc} |
|
25 | - */ |
|
24 | + * {@inheritDoc} |
|
25 | + */ |
|
26 | 26 | static public function depends_on() |
27 | 27 | { |
28 | 28 | return array('\phpbb\ads\migrations\v10x\m1_initial_schema'); |
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
32 | - * Add the views and clicks to ads table |
|
33 | - * |
|
34 | - * @return array Array of table schema |
|
35 | - * @access public |
|
36 | - */ |
|
32 | + * Add the views and clicks to ads table |
|
33 | + * |
|
34 | + * @return array Array of table schema |
|
35 | + * @access public |
|
36 | + */ |
|
37 | 37 | public function update_schema() |
38 | 38 | { |
39 | 39 | return array( |
@@ -57,11 +57,11 @@ discard block |
||
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
60 | - * Drop the views and clicks from ads table |
|
61 | - * |
|
62 | - * @return array Array of table schema |
|
63 | - * @access public |
|
64 | - */ |
|
60 | + * Drop the views and clicks from ads table |
|
61 | + * |
|
62 | + * @return array Array of table schema |
|
63 | + * @access public |
|
64 | + */ |
|
65 | 65 | public function revert_schema() |
66 | 66 | { |
67 | 67 | return array( |