1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Rennokki\DynamoDb\DynamoDb; |
4
|
|
|
|
5
|
|
|
use Aws\DynamoDb\DynamoDbClient; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Class ExecutableQuery |
9
|
|
|
* |
10
|
|
|
* @package Rennokki\DynamoDb\DynamoDb |
11
|
|
|
* |
12
|
|
|
* @method \Aws\Result batchGetItem() |
13
|
|
|
* @method \GuzzleHttp\Promise\Promise batchGetItemAsync() |
14
|
|
|
* @method \Aws\Result batchWriteItem() |
15
|
|
|
* @method \GuzzleHttp\Promise\Promise batchWriteItemAsync() |
16
|
|
|
* @method \Aws\Result createTable() |
17
|
|
|
* @method \GuzzleHttp\Promise\Promise createTableAsync() |
18
|
|
|
* @method \Aws\Result deleteItem() |
19
|
|
|
* @method \GuzzleHttp\Promise\Promise deleteItemAsync() |
20
|
|
|
* @method \Aws\Result deleteTable() |
21
|
|
|
* @method \GuzzleHttp\Promise\Promise deleteTableAsync() |
22
|
|
|
* @method \Aws\Result describeTable() |
23
|
|
|
* @method \GuzzleHttp\Promise\Promise describeTableAsync() |
24
|
|
|
* @method \Aws\Result getItem() |
25
|
|
|
* @method \GuzzleHttp\Promise\Promise getItemAsync() |
26
|
|
|
* @method \Aws\Result listTables() |
27
|
|
|
* @method \GuzzleHttp\Promise\Promise listTablesAsync() |
28
|
|
|
* @method \Aws\Result putItem() |
29
|
|
|
* @method \GuzzleHttp\Promise\Promise putItemAsync() |
30
|
|
|
* @method \Aws\Result query() |
31
|
|
|
* @method \GuzzleHttp\Promise\Promise queryAsync() |
32
|
|
|
* @method \Aws\Result scan() |
33
|
|
|
* @method \GuzzleHttp\Promise\Promise scanAsync() |
34
|
|
|
* @method \Aws\Result updateItem() |
35
|
|
|
* @method \GuzzleHttp\Promise\Promise updateItemAsync() |
36
|
|
|
* @method \Aws\Result updateTable() |
37
|
|
|
* @method \GuzzleHttp\Promise\Promise updateTableAsync() |
38
|
|
|
* @method \Aws\Result createBackup() (supported in versions 2012-08-10) |
39
|
|
|
* @method \GuzzleHttp\Promise\Promise createBackupAsync() (supported in versions 2012-08-10) |
40
|
|
|
* @method \Aws\Result createGlobalTable() (supported in versions 2012-08-10) |
41
|
|
|
* @method \GuzzleHttp\Promise\Promise createGlobalTableAsync() (supported in versions 2012-08-10) |
42
|
|
|
* @method \Aws\Result deleteBackup() (supported in versions 2012-08-10) |
43
|
|
|
* @method \GuzzleHttp\Promise\Promise deleteBackupAsync() (supported in versions 2012-08-10) |
44
|
|
|
* @method \Aws\Result describeBackup() (supported in versions 2012-08-10) |
45
|
|
|
* @method \GuzzleHttp\Promise\Promise describeBackupAsync() (supported in versions 2012-08-10) |
46
|
|
|
* @method \Aws\Result describeContinuousBackups() (supported in versions 2012-08-10) |
47
|
|
|
* @method \GuzzleHttp\Promise\Promise describeContinuousBackupsAsync() (supported in versions 2012-08-10) |
48
|
|
|
* @method \Aws\Result describeGlobalTable() (supported in versions 2012-08-10) |
49
|
|
|
* @method \GuzzleHttp\Promise\Promise describeGlobalTableAsync() (supported in versions 2012-08-10) |
50
|
|
|
* @method \Aws\Result describeLimits() (supported in versions 2012-08-10) |
51
|
|
|
* @method \GuzzleHttp\Promise\Promise describeLimitsAsync() (supported in versions 2012-08-10) |
52
|
|
|
* @method \Aws\Result describeTimeToLive() (supported in versions 2012-08-10) |
53
|
|
|
* @method \GuzzleHttp\Promise\Promise describeTimeToLiveAsync() (supported in versions 2012-08-10) |
54
|
|
|
* @method \Aws\Result listBackups() (supported in versions 2012-08-10) |
55
|
|
|
* @method \GuzzleHttp\Promise\Promise listBackupsAsync() (supported in versions 2012-08-10) |
56
|
|
|
* @method \Aws\Result listGlobalTables() (supported in versions 2012-08-10) |
57
|
|
|
* @method \GuzzleHttp\Promise\Promise listGlobalTablesAsync() (supported in versions 2012-08-10) |
58
|
|
|
* @method \Aws\Result listTagsOfResource() (supported in versions 2012-08-10) |
59
|
|
|
* @method \GuzzleHttp\Promise\Promise listTagsOfResourceAsync() (supported in versions 2012-08-10) |
60
|
|
|
* @method \Aws\Result restoreTableFromBackup() (supported in versions 2012-08-10) |
61
|
|
|
* @method \GuzzleHttp\Promise\Promise restoreTableFromBackupAsync() (supported in versions 2012-08-10) |
62
|
|
|
* @method \Aws\Result tagResource() (supported in versions 2012-08-10) |
63
|
|
|
* @method \GuzzleHttp\Promise\Promise tagResourceAsync() (supported in versions 2012-08-10) |
64
|
|
|
* @method \Aws\Result untagResource() (supported in versions 2012-08-10) |
65
|
|
|
* @method \GuzzleHttp\Promise\Promise untagResourceAsync() (supported in versions 2012-08-10) |
66
|
|
|
* @method \Aws\Result updateGlobalTable() (supported in versions 2012-08-10) |
67
|
|
|
* @method \GuzzleHttp\Promise\Promise updateGlobalTableAsync() (supported in versions 2012-08-10) |
68
|
|
|
* @method \Aws\Result updateTimeToLive() (supported in versions 2012-08-10) |
69
|
|
|
* @method \GuzzleHttp\Promise\Promise updateTimeToLiveAsync() (supported in versions 2012-08-10) |
70
|
|
|
*/ |
71
|
|
|
class ExecutableQuery |
72
|
|
|
{ |
73
|
|
|
/** |
74
|
|
|
* @var DynamoDbClient |
75
|
|
|
*/ |
76
|
|
|
private $client; |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @var array |
80
|
|
|
*/ |
81
|
|
|
public $query; |
82
|
|
|
|
83
|
|
|
public function __construct(DynamoDbClient $client, array $query) |
84
|
|
|
{ |
85
|
|
|
$this->client = $client; |
86
|
|
|
$this->query = $query; |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* @param string $method |
91
|
|
|
* @param array $parameters |
92
|
|
|
* @return mixed |
93
|
|
|
*/ |
94
|
|
|
public function __call($method, $parameters) |
95
|
|
|
{ |
96
|
|
|
return $this->client->{$method}($this->query); |
97
|
|
|
} |
98
|
|
|
} |
99
|
|
|
|