diff --git a/core/lib/Drupal/Core/KeyValueStore/DatabaseStorageSortedSet.php b/core/lib/Drupal/Core/KeyValueStore/DatabaseStorageSortedSet.php index bbd56bd..c01196c 100644 --- a/core/lib/Drupal/Core/KeyValueStore/DatabaseStorageSortedSet.php +++ b/core/lib/Drupal/Core/KeyValueStore/DatabaseStorageSortedSet.php @@ -55,6 +55,7 @@ public function __construct($collection, SerializationInterface $serializer, Con */ public function add($score, $member) { $this->addMultiple(array(array($score => $member))); + return $this; } /** @@ -75,6 +76,7 @@ public function addMultiple(array $pairs) { ->execute(); } } + return $this; } /** diff --git a/core/lib/Drupal/Core/KeyValueStore/KeyValueStoreSortedSetInterface.php b/core/lib/Drupal/Core/KeyValueStore/KeyValueStoreSortedSetInterface.php index b59fe6f..98d9181 100644 --- a/core/lib/Drupal/Core/KeyValueStore/KeyValueStoreSortedSetInterface.php +++ b/core/lib/Drupal/Core/KeyValueStore/KeyValueStoreSortedSetInterface.php @@ -5,7 +5,7 @@ /** * Defines the interface for sorted data in a key/value store. * - * An example would be an index of items, which have an order, where the last + * An example would be an index of items, ordered by key, where the last * item or a range of items may be required. */ interface KeyValueStoreSortedSetInterface { @@ -16,12 +16,16 @@ * generate a sequential value. * @param mixed $member * The value of the item. + * + * @return $this */ public function add($score, $member); /** * @param array $pairs * An array of key/value pairs to add. + * + * @return $this */ public function addMultiple(array $pairs); diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 02e7738..5676fee 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -1848,7 +1848,7 @@ function system_update_8300() { // KEY is an SQL reserved word, so use 'name' as the key's field name. 'name' => array( 'description' => 'The index or score key for the value.', - 'type' => 'int', + 'type' => 'float', 'not null' => TRUE, 'default' => 0, 'size' => 'big', @@ -1862,7 +1862,6 @@ function system_update_8300() { ), 'indexes' => array( 'collection_name' => array('collection', 'name'), - 'name' => array('name'), ), ); \Drupal::database()->schema()->createTable('key_value_sorted', $table);