Documentation

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

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
since
4.0.0
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
since
4.0.0
Return values
void

count()

public count() : int
Tags
since
4.0.0
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

since
4.0.0
Return values
void

empty()

public empty() : bool
Tags
since
4.0.0
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
since
4.0.0
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
since
4.0.0
Return values
mixed

the value or null

getIterator()

Create new iterator to walk through the list.

public getIterator() : Traversable

Implementation of

Tags
since
4.0.0
Return values
Traversable

iterator to enumerate elements of the list

offsetExists()

Checks whether an offset exists.

public offsetExists(mixed $offset) : bool

Implementation of .

Parameters
$offset : mixed

key of the entry to check

Tags
since
4.0.0
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

Implementation of .

Parameters
$offset : mixed

key of the entry to get

Tags
since
4.0.0
Return values
mixed

the value or null

offsetSet()

Assign a value to the specified offset.

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

Implementation of .

Parameters
$offset : mixed

key of the entry to assign

$value : mixed

new value

Tags
throws
InvalidArgumentException
since
4.0.0
Return values
void

offsetUnset()

Unset an offset.

public offsetUnset(mixed $offset) : void

Implementation of .

Parameters
$offset : mixed

key of the entry to remove

Tags
throws
OutOfBoundsException

if the index does not exist

since
4.0.0
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

Tags
throws
InvalidArgumentException
since
4.0.0
Return values
void

        

Search results