diff --git a/DynamoDBWrapper.php b/DynamoDBWrapper.php index 1791bf9..005d882 100644 --- a/DynamoDBWrapper.php +++ b/DynamoDBWrapper.php @@ -1,5 +1,7 @@ client = DynamoDbClient::factory($args); + } + } + + public static function createFromClient($client) + { + $dyn = new DynamoDBWrapper(); + $dyn->client = $client; + + return $dyn; } public function get($tableName, $key, $options = array()) @@ -117,7 +130,7 @@ public function count($tableName, $keyConditions, $options = array()) public function scan($tableName, $filter, $limit = null) { if (empty($filter)) { - $scanFilter = null; + $scanFilter = array(); } else { $scanFilter = $this->convertConditions($filter); } @@ -442,7 +455,7 @@ protected function convertItems($items) /** * convert string attribute paramter to array components. - * + * * @param string $attribute double colon separated string "::" * @return array parsed parameter. [0]=, [1]= */