| Total Complexity | 4 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | abstract class AbstractItemOperation extends AbstractTableAwareOperation |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var array Values that can be substituted in an expression. |
||
| 11 | */ |
||
| 12 | protected $expressionAttributeValues = []; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var string The level of detail about provisioned throughput consumption that is returned in the response. |
||
| 16 | */ |
||
| 17 | protected $returnConsumedCapacity = ConsumedCapacityOptions::NONE; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Adds an ExpressionAttributeValue to the request. |
||
| 21 | * |
||
| 22 | * @param string $key The attribute token. |
||
| 23 | * @param mixed $value The attribute value. |
||
| 24 | * @return AbstractItemOperation An implementation of this abstract. |
||
| 25 | */ |
||
| 26 | 8 | final public function addExpressionAttributeValue(string $key, $value): AbstractItemOperation |
|
| 27 | { |
||
| 28 | 8 | $this->expressionAttributeValues[sprintf(':%s', $key)] = $this->marshaler->marshalValue($value); |
|
| 29 | 8 | return $this; |
|
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Registers the desired level of consumption detail to return. |
||
| 34 | * |
||
| 35 | * @param string $returnConsumedCapacity The level of consumption detail to return. |
||
| 36 | * @return AbstractItemOperation An implementation of this abstract. |
||
| 37 | */ |
||
| 38 | 1 | final public function setReturnConsumedCapacity(string $returnConsumedCapacity): AbstractItemOperation |
|
| 39 | { |
||
| 40 | 1 | $this->returnConsumedCapacity = $returnConsumedCapacity; |
|
| 41 | 1 | return $this; |
|
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * {@inheritDoc} |
||
| 46 | */ |
||
| 47 | 19 | public function toArray(): array |
|
| 55 | } |
||
| 56 | } |
||
| 57 |