protected function setupDynamoDb() { if (is_null(static::$dynamoDb)) { static::$dynamoDb = App::make('BaoPham\\DynamoDb\\DynamoDbClientInterface'); } $this->client = static::$dynamoDb->getClient(); $this->marshaler = static::$dynamoDb->getMarshaler(); $this->attributeFilter = static::$dynamoDb->getAttributeFilter(); }
/** * Class constructor. * * @param array $attributes The attributes to set. * @param DynamoDbClientInterface|null $dynamoDb The client service. */ public function __construct(array $attributes = [], DynamoDbClientInterface $dynamoDb = null) { parent::__construct($attributes); // Initialize the client. if (static::$dynamoDb === null) { if ($dynamoDb === null) { static::$dynamoDb = app('Nord\\Lumen\\DynamoDb\\Contracts\\DynamoDbClientInterface'); } else { static::$dynamoDb = $dynamoDb; } } $this->setupDynamoDb(); }