Objective

  1. #2190723: Add a KeyValueStore\FileStorage to replace e.g. ConfigStorage discovered the need for being able to check whether a key/value store has a key (without retrieving the value).
  2. Such a method can be easily supported by any key/value store — worst case implementation is to actually get the key and check whether it has a value.

Proposed solution

  1. Add a new has() method to KeyValueStoreInterface.
CommentFileSizeAuthor
#1 kv.has_.1.patch5.8 KBsun

Comments

sun’s picture

Status: Active » Needs review
StatusFileSize
new5.8 KB
  1. Added KeyValueStoreInterface::has().
  2. Added test coverage.
Crell’s picture

Status: Needs review » Reviewed & tested by the community

Seems reasonable unless the bot disagrees.

tim.plunkett’s picture

I just wtf'd really hard when I went to use this and it didn't work.
+1

I even went ahead and wrote a draft change notice, just in case anyone was using this and wondering about the absence of has():
https://drupal.org/node/2217597

tim.plunkett’s picture

Issue tags: +KV Entity Storage

Oh and this blocks the KV entity storage I'm working on.

tim.plunkett’s picture

sun’s picture

1: kv.has_.1.patch queued for re-testing.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Seems reasonable.

Committed and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.