當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DynamoDbClient::listTables方法代碼示例

本文整理匯總了PHP中Aws\DynamoDb\DynamoDbClient::listTables方法的典型用法代碼示例。如果您正苦於以下問題:PHP DynamoDbClient::listTables方法的具體用法?PHP DynamoDbClient::listTables怎麽用?PHP DynamoDbClient::listTables使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Aws\DynamoDb\DynamoDbClient的用法示例。


在下文中一共展示了DynamoDbClient::listTables方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: createTable

 /**
  * Create the table
  */
 protected static function createTable($wait = false)
 {
     $tables = self::$dynamodb->listTables();
     if (in_array(self::TABLE_NAME, $tables['TableNames'])) {
         self::deleteTable(true);
     }
     self::$dynamodb->createTable(['TableName' => self::TABLE_NAME, 'AttributeDefinitions' => [['AttributeName' => 'key', 'AttributeType' => 'S']], 'KeySchema' => [['AttributeName' => 'key', 'KeyType' => 'HASH']], 'ProvisionedThroughput' => ['ReadCapacityUnits' => 1, 'WriteCapacityUnits' => 1]]);
     if (!$wait) {
         return;
     }
     self::$dynamodb->waitUntil('TableExists', ['TableName' => self::TABLE_NAME, 'waiter.interval' => 1, 'waiter.max_attempts' => 5]);
 }
開發者ID:sven4ask,項目名稱:config,代碼行數:15,代碼來源:DynamoDBLoaderTest.php

示例2: listTables

 /**
  * List tables via the list_tables call
  * @param integer $limit
  * @param string $exclusiveStartTableName
  * @return Table\TableCollection
  */
 public function listTables($limit = null, $exclusiveStartTableName = null)
 {
     if (null !== $this->logger) {
         $this->log('List tables');
     }
     $parameters = array();
     if (null !== $limit) {
         $parameters['Limit'] = $limit;
     }
     if (null !== $exclusiveStartTableName) {
         $parameters['ExclusiveStartTableName'] = $exclusiveStartTableName;
     }
     if (null !== $this->logger) {
         $this->log('ListTable request paramaters : ' . print_r($parameters, true), Logger::DEBUG);
     }
     $response = $this->connector->listTables($parameters);
     if (null !== $this->logger) {
         $this->log('ListTable request response : ' . print_r($response, true), Logger::DEBUG);
     }
     $tables = new Table\TableCollection(isset($response['LastEvaluatedTableName']) ? $response['LastEvaluatedTableName'] : null);
     if (!empty($response['TableNames'])) {
         foreach ($response['TableNames'] as $table) {
             $tables->add($table);
         }
     }
     return $tables;
 }
開發者ID:16hands,項目名稱:riverline-dynamodb,代碼行數:33,代碼來源:Connection.php

示例3: getTables

 /**
  * @return array
  */
 public function getTables()
 {
     $out = [];
     do {
         $result = $this->dbConn->listTables(['Limit' => 100, 'ExclusiveStartTableName' => isset($result) ? $result['LastEvaluatedTableName'] : null]);
         $out = array_merge($out, $result['TableNames']);
     } while ($result['LastEvaluatedTableName']);
     return $out;
 }
開發者ID:pkdevboxy,項目名稱:df-aws,代碼行數:12,代碼來源:DynamoDb.php

示例4: listTables

 /**
  * Returns an array of all the tables associated with the current account and endpoint.
  *
  * @param string  $exclusiveStartTableName Name of the table that starts the list.
  * @param integer $limit                   A maximum number of tables to return.
  *
  * @return  Guzzle\Service\Resource\Model
  *
  * @see http://docs.aws.amazon.com/aws-sdk-php/latest/class-Aws.DynamoDb.DynamoDbClient.html#_listTables
  */
 public function listTables($exclusiveStartTableName = null, $limit = null)
 {
     $params = [];
     if (is_string($exclusiveStartTableName)) {
         $params['ExclusiveStartTableName'] = $exclusiveStartTableName;
     }
     if (is_numeric($limit)) {
         $params['Limit'] = $limit;
     }
     return $this->client->listTables($params);
 }
開發者ID:m6web,項目名稱:aws-bundle,代碼行數:21,代碼來源:Client.php

示例5: testListsTables

 /**
  * @depends testCreatesTable
  */
 public function testListsTables()
 {
     $result = $this->client->listTables();
     $this->assertContains($this->table, $result['TableNames']);
 }
開發者ID:romainneutron,項目名稱:aws-sdk-php,代碼行數:8,代碼來源:IntegrationTest.php


注:本文中的Aws\DynamoDb\DynamoDbClient::listTables方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。