1 | <?php |
||
22 | class base |
||
23 | { |
||
24 | /** @var auth */ |
||
25 | protected $auth; |
||
26 | |||
27 | /* @var config */ |
||
28 | protected $config; |
||
29 | |||
30 | /* @var driver_interface */ |
||
31 | protected $db; |
||
32 | |||
33 | /** @var language */ |
||
34 | protected $language; |
||
35 | |||
36 | /* @var user */ |
||
37 | protected $user; |
||
38 | |||
39 | /** @var string */ |
||
40 | protected $table_ideas; |
||
41 | |||
42 | /** @var string */ |
||
43 | protected $table_votes; |
||
44 | |||
45 | /** @var string */ |
||
46 | protected $table_topics; |
||
47 | |||
48 | /** @var string */ |
||
49 | protected $php_ext; |
||
50 | |||
51 | /** |
||
52 | * Constructor |
||
53 | * |
||
54 | * @param auth $auth |
||
55 | * @param config $config |
||
56 | * @param driver_interface $db |
||
57 | * @param language $language |
||
58 | * @param user $user |
||
59 | * @param string $table_ideas |
||
60 | * @param string $table_votes |
||
61 | * @param string $table_topics |
||
62 | * @param string $phpEx |
||
63 | */ |
||
64 | public function __construct(auth $auth, config $config, driver_interface $db, language $language, user $user, $table_ideas, $table_votes, $table_topics, $phpEx) |
||
78 | |||
79 | /** |
||
80 | * Helper method for inserting new idea data |
||
81 | * |
||
82 | * @param array $data The array of data to insert |
||
83 | * @param string $table The name of the table |
||
84 | * |
||
85 | * @return int The ID of the inserted row |
||
86 | */ |
||
87 | protected function insert_idea_data(array $data, $table) |
||
95 | |||
96 | /** |
||
97 | * Helper method for updating idea data |
||
98 | * |
||
99 | * @param array $data The array of data to insert |
||
100 | * @param int $id The ID of the idea |
||
101 | * @param string $table The name of the table |
||
102 | * |
||
103 | * @return void |
||
104 | */ |
||
105 | protected function update_idea_data(array $data, $id, $table) |
||
112 | |||
113 | /** |
||
114 | * Helper method for deleting idea data |
||
115 | * |
||
116 | * @param int $id The ID of the idea |
||
117 | * @param string $table The name of the table |
||
118 | * |
||
119 | * @return bool True if idea was deleted, false otherwise |
||
120 | */ |
||
121 | protected function delete_idea_data($id, $table) |
||
129 | } |
||
130 |