/**
  * Checks if the given table exists.
  *
  * @param string $tableName The table name to check.
  *
  * @return bool True if the table exists, false otherwise.
  */
 protected function tableExists($tableName)
 {
     $found = false;
     $iterator = $this->dynamoDb->getClient()->getIterator('ListTables');
     foreach ($iterator as $table) {
         if ($table === $tableName) {
             $found = true;
         }
     }
     return $found;
 }
Ejemplo n.º 2
0
 /**
  * Set the client and marshaler from the DynamoDB instance.
  */
 protected function setupDynamoDb()
 {
     $this->client = static::$dynamoDb->getClient();
     $this->marshaler = static::$dynamoDb->getMarshaler();
 }