1 | <?php namespace XoopsModules\Smartfaq; |
||
12 | class SmartobjectDbupdater |
||
13 | { |
||
14 | /** |
||
15 | * SmartobjectDbupdater constructor. |
||
16 | */ |
||
17 | public function __construct() |
||
20 | |||
21 | /** |
||
22 | * Use to execute a general query |
||
23 | * |
||
24 | * @param string $query query that will be executed |
||
25 | * @param string $goodmsg message displayed on success |
||
26 | * @param string $badmsg message displayed on error |
||
27 | * |
||
28 | * @return bool true if success, false if an error occured |
||
29 | * |
||
30 | */ |
||
31 | public function runQuery($query, $goodmsg, $badmsg) |
||
45 | |||
46 | /** |
||
47 | * Use to rename a table |
||
48 | * |
||
49 | * @param string $from name of the table to rename |
||
50 | * @param string $to new name of the renamed table |
||
51 | * |
||
52 | * @return bool true if success, false if an error occured |
||
53 | */ |
||
54 | public function renameTable($from, $to) |
||
73 | |||
74 | /** |
||
75 | * Use to update a table |
||
76 | * |
||
77 | * @param object $table {@link SmartDbTable} that will be updated |
||
78 | * |
||
79 | * @see SmartDbTable |
||
80 | * |
||
81 | * @return bool true if success, false if an error occured |
||
82 | */ |
||
83 | public function updateTable($table) |
||
131 | } |
||
132 |
Instead of relying on
global
state, we recommend one of these alternatives:1. Pass all data via parameters
2. Create a class that maintains your state