CouchbaseQueue
in package
implements
Countable, IteratorAggregate
Implementation of the List backed by JSON document in Couchbase collection
Interfaces, Classes, Traits and Enums
- Countable
- IteratorAggregate
Table of Contents
- $collection : CollectionInterface
- $id : string
- $options : CouchbaseQueue
- __construct() : mixed
- CouchbaseQueue constructor.
- clear() : void
- Clears the queue. Effectively it removes backing document, because missing document is an equivalent of the empty collection.
- count() : int
- empty() : bool
- getIterator() : Traversable
- Create new iterator to walk through the list.
- pop() : mixed
- Pop entry from the FIFO queue
- push() : void
- Enqueue new value to the FIFO queue
Properties
$collection
private
CollectionInterface
$collection
$id
private
string
$id
$options
private
CouchbaseQueue
$options
Methods
__construct()
CouchbaseQueue constructor.
public
__construct(string $id, CollectionInterface $collection[, CouchbaseQueue|null $options = null ]) : mixed
Parameters
- $id : string
-
identifier of the backing document.
- $collection : CollectionInterface
-
collection instance, where the document will be stored
- $options : CouchbaseQueue|null = null
Tags
Return values
mixed —clear()
Clears the queue. Effectively it removes backing document, because missing document is an equivalent of the empty collection.
public
clear() : void
Tags
Return values
void —count()
public
count() : int
Tags
Return values
int —number of elements in the list
empty()
public
empty() : bool
Tags
Return values
bool —true if the list is empty
getIterator()
Create new iterator to walk through the list.
public
getIterator() : Traversable
Tags
Return values
Traversable —iterator to enumerate elements of the list
pop()
Pop entry from the FIFO queue
public
pop() : mixed
Tags
Return values
mixed —return the oldest value in the queue or null
push()
Enqueue new value to the FIFO queue
public
push(mixed $value) : void
Parameters
- $value : mixed
-
the value to insert