1 | <?php |
||
4 | class Table |
||
5 | { |
||
6 | private $tableName = ''; |
||
7 | |||
8 | private $pkName = 'id'; |
||
9 | |||
10 | private $cMySQL = null; |
||
11 | |||
12 | public function __construct(\jrdev\MySQL &$cMySQL, $tableName, $tableArgs = []) |
||
23 | |||
24 | public function error() |
||
28 | |||
29 | public function insert($fields) |
||
33 | |||
34 | public function update($fields, $where, $limit = null) |
||
38 | |||
39 | /** |
||
40 | * save |
||
41 | * |
||
42 | * This insert or update a row in the table. If the `id` is in the fields list, |
||
43 | * it will makes an update, otherwise makes an insert. |
||
44 | * |
||
45 | * @param array $fields The fields |
||
46 | * @return int|false The ID of the row that was inserted or updated. Or False on failure. |
||
47 | */ |
||
48 | public function save($fields) |
||
71 | |||
72 | public function delete($where, $limit = null) |
||
76 | } |
||
77 |