Documentation

CouchbaseMap
in package
implements Countable, IteratorAggregate, ArrayAccess

Implementation of the List backed by JSON document in Couchbase collection

Interfaces, Classes and Traits

Countable
IteratorAggregate
ArrayAccess

Table of Contents

$collection  : Collection
$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

Methods

__construct()

CouchbaseList constructor.

public __construct(string $id, Collection $collection[, CouchbaseMap|null $options = null ]) : mixed
Parameters
$id : string

identifier of the backing document.

$collection : Collection

collection instance, where the document will be stored

$options : CouchbaseMap|null = null
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
Return values
void

count()

public count() : int
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
throws
OutOfBoundsException

if the index does not exist

Return values
void

empty()

public empty() : bool
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

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

Return values
mixed

the value or null

getIterator()

Create new iterator to walk through the list.

public getIterator() : Traversable

Implementation of

Return values
Traversable

iterator to enumerate elements of the list

offsetExists()

Checks whether an offset exists.

public offsetExists(mixed $key) : bool

Implementation of .

Parameters
$key : mixed

key of the entry to check

Return values
bool

true if there is an entry associated with the offset

offsetGet()

Retrieves array value for given offset.

public offsetGet(mixed $key) : mixed

Implementation of .

Parameters
$key : mixed
Return values
mixed

the value or null

offsetSet()

Assign a value to the specified offset.

public offsetSet(mixed $key, mixed $value) : void

Implementation of .

Parameters
$key : mixed

key of the entry to assign

$value : mixed

new value

Return values
void

offsetUnset()

Unset an offset.

public offsetUnset(mixed $key) : void

Implementation of .

Parameters
$key : mixed

key of the entry to remove

Tags
throws
OutOfBoundsException

if the index does not exist

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

Return values
void

Search results