Total Complexity | 3 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
8 | abstract class AbstractTableAwareOperation extends AbstractOperation |
||
9 | { |
||
10 | /** |
||
11 | * @var string The table name. |
||
12 | */ |
||
13 | protected $tableName; |
||
14 | |||
15 | /** |
||
16 | * Registers the Marshaler and table name with this object. |
||
17 | * |
||
18 | * @param DynamoDbClient $client The DynamoDb client. |
||
19 | * @param Marshaler $marshaler The Marshaler. |
||
20 | * @param string $tableName The table name. |
||
21 | */ |
||
22 | 39 | public function __construct(DynamoDbClient $client, Marshaler $marshaler, string $tableName) |
|
23 | { |
||
24 | 39 | parent::__construct($client, $marshaler); |
|
25 | 39 | $this->setTableName($tableName); |
|
26 | 39 | } |
|
27 | |||
28 | /** |
||
29 | * Registers the table name. |
||
30 | * |
||
31 | * @param string $tableName The table name. |
||
32 | * @return OperationInterface An implementation of this interface. |
||
33 | */ |
||
34 | 39 | final public function setTableName(string $tableName): OperationInterface |
|
35 | { |
||
36 | 39 | $this->tableName = $tableName; |
|
37 | 39 | return $this; |
|
38 | } |
||
39 | |||
40 | /** |
||
41 | * {@inheritDoc} |
||
42 | */ |
||
43 | 34 | public function toArray(): array |
|
47 | ]; |
||
48 | } |
||
49 | } |
||
50 |