You are here

public function DatabaseMockStorage::claim in Apigee Edge 8

File

tests/modules/apigee_mock_api_client/src/DatabaseMockStorage.php, line 102

Class

DatabaseMockStorage
A mock storage for functional tests.

Namespace

Drupal\apigee_mock_api_client

Code

public function claim() {

  // Delete the item from the queue if it was successfully claimed.
  if ($item = $this->queue
    ->claimItem()) {
    $this->queue
      ->deleteItem($item);
  }

  // Get the result.
  $result = $item ? $item->data : NULL;
  return $result instanceof SerializableMessageWrapper ? $result
    ->getMessage() : $result;
}