marshaler = $marshaler; $this->attributeFilter = $filter; $this->clients = []; } /** * @return \Aws\DynamoDb\DynamoDbClient */ public function getClient($connection = null) { $connection = $connection ?: config('dynamodb.default'); if (isset($this->clients[$connection])) { return $this->clients[$connection]; } $config = config("dynamodb.connections.$connection", []); $config['version'] = '2012-08-10'; $config['debug'] = $this->getDebugOptions(Arr::get($config, 'debug')); $client = new DynamoDbClient($config); $this->clients[$connection] = $client; return $client; } /** * @return \Aws\DynamoDb\Marshaler */ public function getMarshaler() { return $this->marshaler; } /** * @return \BaoPham\DynamoDb\EmptyAttributeFilter */ public function getAttributeFilter() { return $this->attributeFilter; } protected function getDebugOptions($debug = false) { if ($debug === true) { $logfn = function ($msg) { Log::info($msg); }; return ['logfn' => $logfn]; } return $debug; } }