1 | <?php |
||
16 | class DbCached implements DbDriverInterface |
||
17 | { |
||
18 | /** |
||
19 | * @var \ByJG\AnyDataset\DbDriverInterface|null |
||
20 | */ |
||
21 | protected $dbDriver = null; |
||
22 | |||
23 | /** |
||
24 | * @var CacheItemPoolInterface; |
||
25 | */ |
||
26 | protected $cacheEngine = null; |
||
27 | |||
28 | protected $timeToCache = 30; |
||
29 | |||
30 | /** |
||
31 | * DbCached constructor. |
||
32 | * |
||
33 | * @param \ByJG\AnyDataset\DbDriverInterface|null $dbDriver |
||
34 | * @param \Psr\Cache\CacheItemPoolInterface $cacheEngine |
||
35 | * @param int $timeToCache |
||
36 | */ |
||
37 | public function __construct(DbDriverInterface $dbDriver, CacheItemPoolInterface $cacheEngine, $timeToCache = 30) |
||
43 | |||
44 | |||
45 | public function getIterator($sql, $params = null) |
||
64 | |||
65 | protected function getQueryKey($sql, $array) |
||
88 | |||
89 | public function getScalar($sql, $array = null) |
||
93 | |||
94 | public function getAllFields($tablename) |
||
98 | |||
99 | public function execute($sql, $array = null) |
||
103 | |||
104 | public function beginTransaction() |
||
108 | |||
109 | public function commitTransaction() |
||
113 | |||
114 | public function rollbackTransaction() |
||
118 | |||
119 | public function getDbConnection() |
||
123 | |||
124 | public function setAttribute($name, $value) |
||
128 | |||
129 | public function getAttribute($name) |
||
133 | |||
134 | public function executeAndGetId($sql, $array = null) |
||
138 | |||
139 | public function getDbHelper() |
||
143 | |||
144 | /** |
||
145 | * @return Uri |
||
146 | */ |
||
147 | public function getUri() |
||
151 | |||
152 | public function isSupportMultRowset() |
||
156 | |||
157 | public function setSupportMultRowset($multipleRowSet) |
||
161 | } |
||
162 |