@@ -167,7 +167,7 @@ protected function driverConnect(): bool
|
167 | 167 | protected function driverRead(CacheItemInterface $item)
|
168 | 168 | {
|
169 | 169 | try {
|
170 |
| -$options = new Cassandra\ExecutionOptions( |
| 170 | +$options = $this->getCompatibleExecutionOptionsArgument( |
171 | 171 | [
|
172 | 172 | 'arguments' => ['cache_id' => $item->getKey()],
|
173 | 173 | 'page_size' => 1,
|
@@ -203,7 +203,7 @@ protected function driverWrite(CacheItemInterface $item): bool
|
203 | 203 | if ($item instanceof Item) {
|
204 | 204 | try {
|
205 | 205 | $cacheData = $this->encode($this->driverPreWrap($item));
|
206 |
| -$options = new Cassandra\ExecutionOptions( |
| 206 | +$options = $this->getCompatibleExecutionOptionsArgument( |
207 | 207 | [
|
208 | 208 | 'arguments' => [
|
209 | 209 | 'cache_uuid' => new Cassandra\Uuid(),
|
@@ -267,7 +267,7 @@ protected function driverDelete(CacheItemInterface $item): bool
|
267 | 267 | */
|
268 | 268 | if ($item instanceof Item) {
|
269 | 269 | try {
|
270 |
| -$options = new Cassandra\ExecutionOptions( |
| 270 | +$options = $this->getCompatibleExecutionOptionsArgument( |
271 | 271 | [
|
272 | 272 | 'arguments' => [
|
273 | 273 | 'cache_id' => $item->getKey(),
|
@@ -320,4 +320,17 @@ protected function driverClear(): bool
|
320 | 320 | return false;
|
321 | 321 | }
|
322 | 322 | }
|
| 323 | + |
| 324 | +/** |
| 325 | +* @param array<string, mixed> $options |
| 326 | +* @return array<string, mixed>|Cassandra\ExecutionOptions |
| 327 | +*/ |
| 328 | +protected function getCompatibleExecutionOptionsArgument(array $options) |
| 329 | +{ |
| 330 | +if ($this->getConfig()->isUseLegacyExecutionOptions()) { |
| 331 | +return new Cassandra\ExecutionOptions($options); |
| 332 | +} |
| 333 | + |
| 334 | +return $options; |
| 335 | +} |
323 | 336 | }
|
0 commit comments