Arango PHP ODM

Collection
in package
implements JsonSerializable

Represents an ArangoDB collection

Tags
author

Lucas S. Vieira

Table of Contents

Interfaces

JsonSerializable

Methods

__construct()  : mixed
Collection constructor.
__get()  : mixed|null
Get some attribute
__set()  : mixed
Set a attribute
__toString()  : string
Return an string representation of document
addIndex()  : bool
Create a index for collection
all()  : CursorInterface|bool
Returns a cursor for access all documents on this Collection
count()  : int
Return the number of documents in a collection.
drop()  : bool
Drops the collection on database
dropIndex()  : bool
Drops a index of collection
findByKey()  : Document|false
Find a document by it's key
getAttributes()  : array<string|int, mixed>
Return the collection attributes on array
getChecksum()  : string
Return the checksum of collection metadata
getDatabase()  : Database
Returns the database where collection belongs
getGloballyUniqueId()  : string
Return the globally Unique ID of collection
getId()  : string|null
Return the ID of collection
getIndexes()  : ArrayList
Return all indexes of collection
getName()  : string
Return the name of collection
getRevision()  : string
Return the revision of collection
getStatus()  : int
Return the status of collection
getStatusDescription()  : string
Return a string description of status
getType()  : string
Return the collection type
isGraph()  : bool
Return if the collection is a graph collection
isNew()  : bool
Returns true if is a new object
isSystem()  : bool
Checks if the collection is a system collection
jsonSerialize()  : mixed
load()  : bool
Loads the collection on server
recalculateCount()  : bool
Recalculates the document count of a collection, if it ever becomes inconsistent.
rename()  : bool
Renames the collection
save()  : bool
Saves or update the collection.
setAttributes()  : void
Set collection attributes
toArray()  : array<string|int, mixed>
Return an array representation of collection
truncate()  : bool
Truncate the collection

Methods

__get()

Get some attribute

public __get(string $name) : mixed|null
Parameters
$name : string
Return values
mixed|null

__set()

Set a attribute

public __set(string $name, mixed $value) : mixed
Parameters
$name : string
$value : mixed
Tags
throws
Exception

__toString()

Return an string representation of document

public __toString() : string
Return values
string

count()

Return the number of documents in a collection.

public count() : int
Tags
throws
DatabaseException|GuzzleException
Return values
int

Total count of documents on collection.

getAttributes()

Return the collection attributes on array

public getAttributes() : array<string|int, mixed>
Return values
array<string|int, mixed>

getChecksum()

Return the checksum of collection metadata

public getChecksum() : string
Tags
throws
DatabaseException|GuzzleException
Return values
string

getGloballyUniqueId()

Return the globally Unique ID of collection

public getGloballyUniqueId() : string
Return values
string

getId()

Return the ID of collection

public getId() : string|null
Return values
string|null

String if collection exists on database. Null if not.

getName()

Return the name of collection

public getName() : string
Return values
string

getRevision()

Return the revision of collection

public getRevision() : string
Tags
throws
DatabaseException|GuzzleException
Return values
string

getStatus()

Return the status of collection

public getStatus() : int
Return values
int

A integer between 0 and 6

getStatusDescription()

Return a string description of status

public getStatusDescription() : string
Return values
string

getType()

Return the collection type

public getType() : string
Return values
string

isGraph()

Return if the collection is a graph collection

public isGraph() : bool
Return values
bool

isNew()

Returns true if is a new object

public isNew() : bool
Return values
bool

isSystem()

Checks if the collection is a system collection

public isSystem() : bool
Return values
bool

True if is a system collection. False otherwise.

jsonSerialize()

public jsonSerialize() : mixed
Tags
see
JsonSerializable::jsonSerialize()

load()

Loads the collection on server

public load([bool $count = true ]) : bool
Parameters
$count : bool = true
Tags
throws
DatabaseException|GuzzleException
Return values
bool

recalculateCount()

Recalculates the document count of a collection, if it ever becomes inconsistent.

public recalculateCount() : bool
Tags
throws
DatabaseException|GuzzleException
Return values
bool

rename()

Renames the collection

public rename(string $newName) : bool
Parameters
$newName : string

The new name of collection.

Tags
throws
DatabaseException|GuzzleException
Return values
bool

save()

Saves or update the collection.

public save() : bool

Except for 'waitForSync', 'journalSize' and 'name', a collection can not be modified after creation. For change 'name', the method 'rename' must be used.

Tags
throws
DatabaseException|GuzzleException
Return values
bool

setAttributes()

Set collection attributes

public setAttributes(array<string|int, mixed> $data) : void
Parameters
$data : array<string|int, mixed>

toArray()

Return an array representation of collection

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results