当前位置: 首页>>代码示例>>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;未经允许,请勿转载。