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


PHP DynamoDbClient::formatAttributes方法代碼示例

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


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

示例1: write

 /**
  * {@inheritdoc}
  */
 protected function write(array $record)
 {
     $filtered = $this->filterEmptyFields($record['formatted']);
     if ($this->version === 3) {
         $formatted = $this->marshaler->marshalItem($filtered);
     } else {
         $formatted = $this->client->formatAttributes($filtered);
     }
     $this->client->putItem(['TableName' => $this->table, 'Item' => $formatted]);
 }
開發者ID:earncef,項目名稱:monolog,代碼行數:13,代碼來源:DynamoDbHandler.php

示例2: testImplementsCustomExponentialBackoffStrategy

 /**
  * @depends testIteratesOverScan
  */
 public function testImplementsCustomExponentialBackoffStrategy()
 {
     self::log('Getting an item a bunch of times in parallel');
     $batch = BatchBuilder::factory()->transferCommands(100)->build();
     $s = microtime(true);
     $total = 300;
     for ($i = 0; $i < $total; $i++) {
         $command = $this->client->getCommand('GetItem', array('TableName' => $this->table, 'Key' => $this->client->formatAttributes(array('HashKeyElement' => 'Test', 'RangeKeyElement' => 10))));
         $batch->add($command);
     }
     $retries = 0;
     foreach ($batch->flush() as $command) {
         $retries += $command->getRequest()->getParams()->get(BackoffPlugin::RETRY_PARAM);
     }
     $elapsed = microtime(true) - $s;
     self::log("Got the item {$total} times with {$retries} retries in {$elapsed} seconds");
 }
開發者ID:romainneutron,項目名稱:aws-sdk-php,代碼行數:20,代碼來源:IntegrationTest.php

示例3: insert

 /**
  * {@inheritDoc}
  */
 public function insert($storageName, $key, array $data)
 {
     $this->createTable($storageName);
     $this->prepareData($key, $data);
     $result = $this->client->putItem(['TableName' => $storageName, 'Item' => $this->client->formatAttributes($data), 'ReturnConsumedCapacity' => 'TOTAL']);
 }
開發者ID:billschaller,項目名稱:KeyValueStore,代碼行數:9,代碼來源:DynamoDbStorage.php

示例4: write

 /**
  * {@inheritdoc}
  */
 protected function write(array $record)
 {
     $filtered = $this->filterEmptyFields($record['formatted']);
     $formatted = $this->client->formatAttributes($filtered);
     $this->client->putItem(array('TableName' => $this->table, 'Item' => $formatted));
 }
開發者ID:saj696,項目名稱:pipe,代碼行數:9,代碼來源:DynamoDbHandler.php

示例5: formatAttributes

 /**
  * Formats an array of values as DynamoDB attributes.
  *
  * @param array  $values The values to format for DynamoDB.
  * @param string $format The type of format (e.g. put, update).
  *
  * @return array The formatted values
  */
 public function formatAttributes(array $values, $format = Attribute::FORMAT_PUT)
 {
     return $this->client->formatAttributes($values, $format);
 }
開發者ID:m6web,項目名稱:aws-bundle,代碼行數:12,代碼來源:Client.php


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