@@ -32,21 +32,21 @@ public function __construct(DynamoDbClientInterface $dynamoDb)
32
32
$ this ->attributeFilter = $ dynamoDb ->getAttributeFilter ();
33
33
}
34
34
35
- protected function _save ($ model )
35
+ private function saveToDynamoDb ($ model )
36
36
{
37
37
$ attrs = $ model ->attributesToArray ();
38
- // $this->attributeFilter->filter($attrs);
38
+
39
39
try {
40
40
$ this ->dynamoDbClient ->putItem ([
41
41
'TableName ' => $ model ->getDynamoDbTableName (),
42
42
'Item ' => $ this ->marshaler ->marshalItem ($ attrs ),
43
43
]);
44
44
} catch (Exception $ e ) {
45
- Log::info ($ e );
45
+ Log::error ($ e );
46
46
}
47
47
}
48
48
49
- protected function _delete ($ model )
49
+ private function deleteFromDynamoDb ($ model )
50
50
{
51
51
$ key = [$ model ->getKeyName () => $ model ->getKey ()];
52
52
@@ -56,27 +56,27 @@ protected function _delete($model)
56
56
'Key ' => $ this ->marshaler ->marshalItem ($ key ),
57
57
]);
58
58
} catch (Exception $ e ) {
59
- Log::info ($ e );
59
+ Log::error ($ e );
60
60
}
61
61
}
62
62
63
63
public function created ($ model )
64
64
{
65
- $ this ->_save ($ model );
65
+ $ this ->saveToDynamoDb ($ model );
66
66
}
67
67
68
68
public function updated ($ model )
69
69
{
70
- $ this ->_save ($ model );
70
+ $ this ->saveToDynamoDb ($ model );
71
71
}
72
72
73
73
public function deleted ($ model )
74
74
{
75
- $ this ->_delete ($ model );
75
+ $ this ->deleteFromDynamoDb ($ model );
76
76
}
77
77
78
78
public function restored ($ model )
79
79
{
80
- $ this ->_save ($ model );
80
+ $ this ->saveToDynamoDb ($ model );
81
81
}
82
82
}
0 commit comments