Skip to content

Commit e220abb

Browse files
committed
Rename ideas object to entity
1 parent 80639d4 commit e220abb

5 files changed

Lines changed: 23 additions & 23 deletions

File tree

controller/base.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ abstract class base
3232
/* @var helper */
3333
protected $helper;
3434

35-
/* @var \phpbb\ideas\factory\ideas|\phpbb\ideas\factory\idea */
36-
protected $ideas;
35+
/* @var \phpbb\ideas\factory\base */
36+
protected $entity;
3737

3838
/** @var language */
3939
protected $language;
@@ -92,11 +92,11 @@ public function __construct(auth $auth, config $config, helper $helper, language
9292
/**
9393
* Set the Ideas entity
9494
*
95-
* @param \phpbb\ideas\factory\ideas|\phpbb\ideas\factory\idea $entity
95+
* @param \phpbb\ideas\factory\base $entity
9696
*/
9797
public function get_entity($entity)
9898
{
99-
$this->ideas = $entity;
99+
$this->entity = $entity;
100100
}
101101

102102
/**

controller/idea_controller.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class idea_controller extends base
2121
protected $data;
2222

2323
/* @var \phpbb\ideas\factory\idea */
24-
protected $ideas;
24+
protected $entity;
2525

2626
/**
2727
* Controller for /idea/{idea_id}
@@ -37,7 +37,7 @@ public function idea($idea_id)
3737
throw new http_exception(404, 'IDEAS_NOT_AVAILABLE');
3838
}
3939

40-
$this->data = $this->ideas->get_idea($idea_id);
40+
$this->data = $this->entity->get_idea($idea_id);
4141
if (!$this->data)
4242
{
4343
throw new http_exception(404, 'IDEA_NOT_FOUND');
@@ -83,7 +83,7 @@ public function delete()
8383
if (confirm_box(true))
8484
{
8585
include $this->root_path . 'includes/functions_admin.' . $this->php_ext;
86-
$this->ideas->delete($this->data['idea_id'], $this->data['topic_id']);
86+
$this->entity->delete($this->data['idea_id'], $this->data['topic_id']);
8787

8888
$redirect = $this->helper->route('phpbb_ideas_index_controller');
8989
$message = $this->language->lang('IDEA_DELETED') . '<br /><br />' . $this->language->lang('RETURN_IDEAS', '<a href="' . $redirect . '">', '</a>');
@@ -122,7 +122,7 @@ public function duplicate()
122122
if ($this->is_mod() && check_link_hash($this->get_hash(), "duplicate_{$this->data['idea_id']}"))
123123
{
124124
$duplicate = $this->request->variable('duplicate', 0);
125-
return $this->ideas->set_duplicate($this->data['idea_id'], $duplicate);
125+
return $this->entity->set_duplicate($this->data['idea_id'], $duplicate);
126126
}
127127

128128
return false;
@@ -143,7 +143,7 @@ public function removevote()
143143

144144
if ($this->auth->acl_get('f_vote', (int) $this->config['ideas_forum_id']))
145145
{
146-
$result = $this->ideas->remove_vote($this->data, $this->user->data['user_id']);
146+
$result = $this->entity->remove_vote($this->data, $this->user->data['user_id']);
147147
}
148148
else
149149
{
@@ -164,7 +164,7 @@ public function rfc()
164164
if (($this->is_own() || $this->is_mod()) && check_link_hash($this->get_hash(), "rfc_{$this->data['idea_id']}"))
165165
{
166166
$rfc = $this->request->variable('rfc', '');
167-
return $this->ideas->set_rfc($this->data['idea_id'], $rfc);
167+
return $this->entity->set_rfc($this->data['idea_id'], $rfc);
168168
}
169169

170170
return false;
@@ -182,7 +182,7 @@ public function status()
182182

183183
if ($status && $this->is_mod() && check_link_hash($this->get_hash(), "status_{$this->data['idea_id']}"))
184184
{
185-
$this->ideas->set_status($this->data['idea_id'], $status);
185+
$this->entity->set_status($this->data['idea_id'], $status);
186186
return true;
187187
}
188188

@@ -200,7 +200,7 @@ public function ticket()
200200
if (($this->is_own() || $this->is_mod()) && check_link_hash($this->get_hash(), "ticket_{$this->data['idea_id']}"))
201201
{
202202
$ticket = $this->request->variable('ticket', 0);
203-
return $this->ideas->set_ticket($this->data['idea_id'], $ticket);
203+
return $this->entity->set_ticket($this->data['idea_id'], $ticket);
204204
}
205205

206206
return false;
@@ -217,7 +217,7 @@ public function implemented()
217217
if ($this->is_mod() && check_link_hash($this->get_hash(), "implemented_{$this->data['idea_id']}"))
218218
{
219219
$version = $this->request->variable('implemented', '');
220-
return $this->ideas->set_implemented($this->data['idea_id'], $version);
220+
return $this->entity->set_implemented($this->data['idea_id'], $version);
221221
}
222222

223223
return false;
@@ -240,7 +240,7 @@ public function vote()
240240

241241
if ($this->auth->acl_get('f_vote', (int) $this->config['ideas_forum_id']))
242242
{
243-
$result = $this->ideas->vote($this->data, $this->user->data['user_id'], $vote);
243+
$result = $this->entity->vote($this->data, $this->user->data['user_id'], $vote);
244244
}
245245
else
246246
{

controller/index_controller.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class index_controller extends base
1717
{
1818
/* @var \phpbb\ideas\factory\ideas */
19-
protected $ideas;
19+
protected $entity;
2020

2121
/**
2222
* Controller for /ideas
@@ -32,15 +32,15 @@ public function index()
3232
}
3333

3434
// Generate latest ideas
35-
$ideas = $this->ideas->get_ideas(ext::NUM_IDEAS, ext::SORT_DATE, 'DESC');
35+
$ideas = $this->entity->get_ideas(ext::NUM_IDEAS, ext::SORT_DATE, 'DESC');
3636
$this->assign_template_block_vars('latest_ideas', $ideas);
3737

3838
// Generate top ideas
39-
$ideas = $this->ideas->get_ideas(ext::NUM_IDEAS, ext::SORT_TOP, 'DESC');
39+
$ideas = $this->entity->get_ideas(ext::NUM_IDEAS, ext::SORT_TOP, 'DESC');
4040
$this->assign_template_block_vars('top_ideas', $ideas);
4141

4242
// Generate recently implemented
43-
$ideas = $this->ideas->get_ideas(ext::NUM_IDEAS, ext::SORT_DATE, 'DESC', ext::$statuses['IMPLEMENTED']);
43+
$ideas = $this->entity->get_ideas(ext::NUM_IDEAS, ext::SORT_DATE, 'DESC', ext::$statuses['IMPLEMENTED']);
4444
$this->assign_template_block_vars('implemented_ideas', $ideas);
4545

4646
$this->template->assign_vars(array(

controller/list_controller.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class list_controller extends base
1717
{
1818
/* @var \phpbb\ideas\factory\ideas */
19-
protected $ideas;
19+
protected $entity;
2020

2121
/**
2222
* Controller for /list/{sort}
@@ -68,14 +68,14 @@ public function ideas_list($sort)
6868
}
6969

7070
// Generate ideas
71-
$ideas = $this->ideas->get_ideas($this->config['posts_per_page'], $sort, $sort_direction, $status, $start);
71+
$ideas = $this->entity->get_ideas($this->config['posts_per_page'], $sort, $sort_direction, $status, $start);
7272
$this->assign_template_block_vars('ideas', $ideas);
7373

7474
// Build list page template output
7575
$this->template->assign_vars(array(
7676
'U_LIST_ACTION' => $this->helper->route('phpbb_ideas_list_controller'),
7777
'U_POST_ACTION' => $this->helper->route('phpbb_ideas_post_controller'),
78-
'IDEAS_COUNT' => $this->ideas->get_idea_count(),
78+
'IDEAS_COUNT' => $this->entity->get_idea_count(),
7979
'STATUS_NAME' => $status_name ?: $this->language->lang('OPEN_IDEAS'),
8080
'STATUS_ARY' => ext::$statuses,
8181
'STATUS' => $u_status,
@@ -110,7 +110,7 @@ public function ideas_list($sort)
110110
$this->helper->route('phpbb_ideas_list_controller', $params),
111111
'pagination',
112112
'start',
113-
$this->ideas->get_idea_count(),
113+
$this->entity->get_idea_count(),
114114
$this->config['posts_per_page'],
115115
$start
116116
);

controller/livesearch_controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class livesearch_controller extends base
1717
{
1818
/* @var \phpbb\ideas\factory\ideas */
19-
protected $ideas;
19+
protected $entity;
2020

2121
/**
2222
* Title search handler

0 commit comments

Comments
 (0)