CouchbaseSet
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 : CouchbaseSet
- __construct() : mixed
- CouchbaseSet constructor.
- add() : void
- Adds new value to the set
- clear() : void
- Clears the set. Effectively it removes backing document, because missing document is an equivalent of the empty collection.
- contains() : bool
- Checks whether an offset exists.
- count() : int
- empty() : bool
- getIterator() : Traversable
- Create new iterator to walk through the set.
- remove() : bool
- Remove entry from the set
Properties
$collection
private
CollectionInterface
$collection
$id
private
string
$id
$options
private
CouchbaseSet
$options
Methods
__construct()
CouchbaseSet constructor.
public
__construct(string $id, CollectionInterface $collection[, CouchbaseSet|null $options = null ]) : mixed
Parameters
- $id : string
-
identifier of the backing document.
- $collection : CollectionInterface
-
collection instance, where the document will be stored
- $options : CouchbaseSet|null = null
Return values
mixed —add()
Adds new value to the set
public
add(mixed $value) : void
Parameters
- $value : mixed
-
the value to insert
Tags
Return values
void —clear()
Clears the set. Effectively it removes backing document, because missing document is an equivalent of the empty collection.
public
clear() : void
Return values
void —contains()
Checks whether an offset exists.
public
contains(mixed $value) : bool
Parameters
- $value : mixed
-
the value to check for existence
Return values
bool —true if there is an entry associated with the offset
count()
public
count() : int
Return values
int —number of elements in the set
empty()
public
empty() : bool
Return values
bool —true if the set is empty
getIterator()
Create new iterator to walk through the set.
public
getIterator() : Traversable
Return values
Traversable —iterator to enumerate elements of the set
remove()
Remove entry from the set
public
remove(mixed $value) : bool
Parameters
- $value : mixed
-
the value to remove (if exists in the Set)
Return values
bool —true if the value has been removed