1 | <?php |
||
19 | class ZendDbAdapterStorage implements StorageInterface |
||
20 | { |
||
21 | const STMT_SELECT = 'SELECT settings FROM :table WHERE name = :key'; |
||
22 | const STMT_INSERT = 'INSERT INTO :table (name, settings) VALUES (:key, :value)'; |
||
23 | const STMT_UPDATE = 'UPDATE :table SET settings = :value WHERE name = :key'; |
||
24 | const STMT_DELETE = 'DELETE FROM :table WHERE name = :key'; |
||
25 | |||
26 | private $adapter; |
||
27 | |||
28 | /** |
||
29 | * @var string |
||
30 | */ |
||
31 | private $tableName; |
||
32 | |||
33 | /** |
||
34 | * @param Adapter $adapter |
||
35 | * @param string $tableName |
||
36 | */ |
||
37 | public function __construct(Adapter $adapter, $tableName) |
||
42 | |||
43 | /** |
||
44 | * @param string $key |
||
45 | * |
||
46 | * @return string|null Null if the value is not found |
||
47 | */ |
||
48 | public function get($key) |
||
58 | |||
59 | /** |
||
60 | * @param string $key |
||
61 | * @param string $value |
||
62 | * |
||
63 | * @return void |
||
64 | */ |
||
65 | public function set($key, $value) |
||
76 | |||
77 | /** |
||
78 | * @param string $key |
||
79 | * |
||
80 | * @return void |
||
81 | */ |
||
82 | public function remove($key) |
||
88 | |||
89 | /** |
||
90 | * @param string $sql |
||
91 | * |
||
92 | * @return string |
||
93 | */ |
||
94 | private function getSQLStatement($sql) |
||
98 | } |