1 | <?php |
||
7 | class database extends \PDO |
||
8 | { |
||
9 | protected $extension_manager; |
||
10 | |||
11 | public function __construct() |
||
19 | |||
20 | /** |
||
21 | * @param string $sql |
||
22 | * @return array |
||
23 | */ |
||
24 | public function select($sql, $array = array(), $fetchMode = PDO::FETCH_ASSOC) |
||
34 | |||
35 | /** |
||
36 | * @param string $table |
||
37 | * @return bool |
||
38 | */ |
||
39 | public function insert($table, $data) |
||
54 | |||
55 | /** |
||
56 | * @param string $table |
||
57 | * @param array $data |
||
58 | * @param string $where |
||
59 | * @return bool |
||
60 | */ |
||
61 | public function update($table, $data, $where) |
||
79 | |||
80 | /** |
||
81 | * @param string $table |
||
82 | * @param string $where |
||
83 | * @param int $limit |
||
84 | * @return int |
||
85 | */ |
||
86 | public function delete($table, $where, $limit = 1) |
||
90 | |||
91 | protected function find($path, $prefix, $suffix) |
||
103 | } |
||
104 |
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