CouchbaseMap
in package
implements
Countable, IteratorAggregate, ArrayAccess
Implementation of the List backed by JSON document in Couchbase collection
Interfaces, Classes, Traits and Enums
- Countable
- IteratorAggregate
- ArrayAccess
Table of Contents
- $collection : CollectionInterface
- $id : string
- $options : CouchbaseMap
- __construct() : mixed
- CouchbaseList constructor.
- clear() : void
- Clears the map. Effectively it removes backing document, because missing document is an equivalent of the empty collection.
- count() : int
- delete() : void
- Remove entry by its key.
- empty() : bool
- existsAt() : bool
- Checks whether a key exists.
- get() : mixed
- Retrieves array value for given offset.
- getIterator() : Traversable
- Create new iterator to walk through the list.
- offsetExists() : bool
- Checks whether an offset exists.
- offsetGet() : mixed
- Retrieves array value for given offset.
- offsetSet() : void
- Assign a value to the specified offset.
- offsetUnset() : void
- Unset an offset.
- set() : void
- Insert or update given key with new value.
Properties
$collection
private
CollectionInterface
$collection
$id
private
string
$id
$options
private
CouchbaseMap
$options
Methods
__construct()
CouchbaseList constructor.
public
__construct(string $id, CollectionInterface $collection[, CouchbaseMap|null $options = null ]) : mixed
Parameters
- $id : string
-
identifier of the backing document.
- $collection : CollectionInterface
-
collection instance, where the document will be stored
- $options : CouchbaseMap|null = null
Tags
Return values
mixed —clear()
Clears the map. 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 map
delete()
Remove entry by its key.
public
delete(string $key) : void
Parameters
- $key : string
-
key of the entry to remove
Tags
Return values
void —empty()
public
empty() : bool
Tags
Return values
bool —true if the map is empty
existsAt()
Checks whether a key exists.
public
existsAt(string $key) : bool
Parameters
- $key : string
-
key of the entry to check
Tags
Return values
bool —true if there is an entry associated with the offset
get()
Retrieves array value for given offset.
public
get(string $key) : mixed
Parameters
- $key : string
-
key of the entry to be retrieved
Tags
Return values
mixed —the value or null
getIterator()
Create new iterator to walk through the list.
public
getIterator() : Traversable
Tags
Return values
Traversable —iterator to enumerate elements of the list
offsetExists()
Checks whether an offset exists.
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
-
key of the entry to check
Tags
Return values
bool —true if there is an entry associated with the offset
offsetGet()
Retrieves array value for given offset.
public
offsetGet(mixed $offset) : mixed
Parameters
- $offset : mixed
-
key of the entry to get
Tags
Return values
mixed —the value or null
offsetSet()
Assign a value to the specified offset.
public
offsetSet(mixed $offset, mixed $value) : void
Parameters
- $offset : mixed
-
key of the entry to assign
- $value : mixed
-
new value
Tags
Return values
void —offsetUnset()
Unset an offset.
public
offsetUnset(mixed $offset) : void
Parameters
- $offset : mixed
-
key of the entry to remove
Tags
Return values
void —set()
Insert or update given key with new value.
public
set(string $key, mixed $value) : void
Parameters
- $key : string
-
key of the entry to be inserted/updated
- $value : mixed
-
new value