Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
2 parents cdbc89e + 7efdf3d commit 6264e3c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
6 changes: 3 additions & 3 deletions src/Cache/CacheClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ public function dictionaryFetch(string $cacheName, string $dictionaryName): Dict
*
* @param string $cacheName Name of the cache that contains the dictionary.
* @param string $dictionaryName The dictionary to set the field in. Will be created if it doesn't exist.
* @param array $items The field-value pairs o be stored.
* @param array $elements The field-value pairs to be stored.
* @param CollectionTtl|null $ttl TTL for the dictionary in cache. This TTL takes precedence over the TTL used when initializing a cache client. Defaults to client TTL.
* @return DictionarySetFieldsResponse Represents the result of the dictionary set field operation.
* This result is resolved to a type-safe object of one of the following types:<br>
Expand All @@ -514,9 +514,9 @@ public function dictionaryFetch(string $cacheName, string $dictionaryName): Dict
* &nbsp;&nbsp;// handle error condition<br>
* }</code>
*/
public function dictionarySetFields(string $cacheName, string $dictionaryName, array $items, ?CollectionTtl $ttl = null): DictionarySetFieldsResponse
public function dictionarySetFields(string $cacheName, string $dictionaryName, array $elements, ?CollectionTtl $ttl = null): DictionarySetFieldsResponse
{
return $this->dataClient->dictionarySetFields($cacheName, $dictionaryName, $items, $ttl);
return $this->dataClient->dictionarySetFields($cacheName, $dictionaryName, $elements, $ttl);
}

/**
Expand Down
9 changes: 4 additions & 5 deletions src/Cache/Internal/ScsDataClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@
use function Momento\Utilities\validateElement;
use function Momento\Utilities\validateFieldName;
use function Momento\Utilities\validateFields;
use function Momento\Utilities\validateItems;
use function Momento\Utilities\validateKeys;
use function Momento\Utilities\validateListName;
use function Momento\Utilities\validateNullOrEmpty;
Expand Down Expand Up @@ -560,16 +559,16 @@ public function dictionaryFetch(string $cacheName, string $dictionaryName): Dict
return new DictionaryFetchMiss();
}

public function dictionarySetFields(string $cacheName, string $dictionaryName, array $items, ?CollectionTtl $ttl = null): DictionarySetFieldsResponse
public function dictionarySetFields(string $cacheName, string $dictionaryName, array $elements, ?CollectionTtl $ttl = null): DictionarySetFieldsResponse
{
try {
$collectionTtl = $this->returnCollectionTtl($ttl);
validateCacheName($cacheName);
validateDictionaryName($dictionaryName);
validateKeys(array_keys($items));
validateKeys(array_keys($elements));
$ttlMillis = $this->ttlToMillis($collectionTtl->getTtl());
$protoItems = [];
foreach ($items as $field => $value) {
foreach ($elements as $field => $value) {
$fieldValuePair = new _DictionaryFieldValuePair();
$fieldValuePair->setField($field);
$fieldValuePair->setValue($value);
Expand All @@ -595,7 +594,7 @@ public function dictionaryGetFields(string $cacheName, string $dictionaryName, a
try {
validateCacheName($cacheName);
validateDictionaryName($dictionaryName);
validateItems($fields);
validateFields($fields);
$dictionaryGetFieldsRequest = new _DictionaryGetRequest();
$dictionaryGetFieldsRequest->setDictionaryName($dictionaryName);
$dictionaryGetFieldsRequest->setFields($fields);
Expand Down
7 changes: 0 additions & 7 deletions src/Utilities/_DataValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,6 @@ function validateValueName(string $valueName): void
}
}

if (!function_exists('validateItems')) {
function validateItems(array $items): void
{
validateNullOrEmptyList($items, "Items");
}
}

if (!function_exists('validateOperationTimeout')) {
function validateOperationTimeout(?int $operationTimeout = null)
{
Expand Down

0 comments on commit 6264e3c

Please sign in to comment.