Documentation

CouchbaseList
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  : CouchbaseList
__construct()  : mixed
CouchbaseList constructor.
append()  : void
Inserts new entries in the end of the list.
at()  : mixed
Retrieves array value for given offset.
clear()  : void
Clears the list. Effectively it removes backing document, because missing document is an equivalent of the empty collection.
count()  : int
deleteAt()  : void
Remove entry by its offset.
empty()  : bool
existsAt()  : bool
Checks whether an offset exists.
getIterator()  : Traversable
Create new iterator to walk through the list.
insertAt()  : void
Inserts new entry at given offset. It expands the list shifting all entries after offset to the right.
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.
prepend()  : void
Inserts new entries in the beginning of the list.
replaceAt()  : void
Replace entry by the given value.

Properties

Methods

__construct()

CouchbaseList constructor.

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

identifier of the backing document.

$collection : CollectionInterface

collection instance, where the document will be stored

$options : CouchbaseList|null = null
Tags
since
4.0.0
Return values
mixed —

append()

Inserts new entries in the end of the list.

public append(mixed ...$values) : void
Parameters
$values : mixed

new values to prepend

Tags
throws
InvalidArgumentException
since
4.0.0
Return values
void —

at()

Retrieves array value for given offset.

public at(int $offset) : mixed
Parameters
$offset : int
Tags
since
4.0.0
Return values
mixed —

the value or null

clear()

Clears the list. 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 list

deleteAt()

Remove entry by its offset.

public deleteAt(int $offset) : void
Parameters
$offset : int

offset 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 list is empty

existsAt()

Checks whether an offset exists.

public existsAt(int $offset) : bool
Parameters
$offset : int

offset of the entry to check

Return values
bool —

true if there is an entry associated with the offset

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

insertAt()

Inserts new entry at given offset. It expands the list shifting all entries after offset to the right.

public insertAt(int $offset, mixed ...$values) : void
Parameters
$offset : int

offset where to insert new value

$values : mixed

the values to insert

Tags
since
4.0.0
Return values
void —

offsetExists()

Checks whether an offset exists.

public offsetExists(mixed $offset) : bool

Implementation of .

Parameters
$offset : mixed

offset 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

offset 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

offset of the entry to replace

$value : mixed

new value

Tags
throws
OutOfBoundsException

if the index does not exist

since
4.0.0
Return values
void —

offsetUnset()

Unset an offset.

public offsetUnset(mixed $offset) : void

Implementation of .

Parameters
$offset : mixed

offset of the entry to remove

Tags
throws
OutOfBoundsException

if the index does not exist

since
4.0.0
Return values
void —

prepend()

Inserts new entries in the beginning of the list.

public prepend(mixed ...$values) : void
Parameters
$values : mixed

new value to prepend

Tags
throws
InvalidArgumentException
since
4.0.0
Return values
void —

replaceAt()

Replace entry by the given value.

public replaceAt(int $offset, mixed $value) : void
Parameters
$offset : int

offset of the entry to be replaced

$value : mixed

new value

Tags
since
4.0.0
Return values
void —

        

Search results