Vertex
        
        extends Document
    
    
            
            in package
            
        
    
    
    
Represents an ArangoDB Vertex document
Tags
Table of Contents
Properties
- $attributes : array<string|int, mixed>
- Documents attributes
- $collection : Collection
- Collection where document belongs
- $connection : Connection
- Connection to be used
- $id : string
- Document ID
- $isNew : bool
- If document is a new one or a representation of existing document
- $key : string
- Document key
- $patchDefaultOptions : array<string|int, mixed>
- Default patch options
- $revision : string
- Document revision
- $updateDefaultOptions : array<string|int, mixed>
- Default update options
- $validator : RuleInterface
- Validate primitive types
Methods
- __construct() : mixed
- Document constructor.
- __get() : mixed|null
- Get some attribute.
- __isset() : bool
- Verifies if an attribute is set on document
- __set() : mixed
- Set a attribute
- __toString() : string
- Return a string representation of document.
- __unset() : mixed
- Unset the given attribute of document
- delete() : bool
- Removes a document on server, if possible
- getCollection() : Collection|null
- Returns the document collection
- getId() : string|null
- Returns the document Id
- getKey() : string|null
- Returns the document key
- getRevision() : string|null
- Returns the document revision
- isNew() : bool
- Returns true if is a new object
- jsonSerialize() : array<string|int, mixed>|mixed
- save() : bool
- Save or update the document, if possible
- setCollection() : void
- Sets the collection to add this document
- toArray() : array<string|int, mixed>
- Returns a array representation of document
- setDescriptors() : void
- Set document descriptors
- update() : bool
- Update the document.
Properties
$attributes
Documents attributes
        protected
            array<string|int, mixed>
    $attributes
    
    
    
    
    
    
$collection
Collection where document belongs
        protected
            Collection
    $collection
    
    
    
    
    
    
$connection
Connection to be used
        protected
            Connection
    $connection
    
    
    
    
    
    
$id
Document ID
        protected
            string
    $id
     = ''
    
    
    
    
    
$isNew
If document is a new one or a representation of existing document
        protected
            bool
    $isNew
    
    
    
    
    
    
$key
Document key
        protected
            string
    $key
     = ''
    
    
    
    
    
$patchDefaultOptions
Default patch options
        protected
            array<string|int, mixed>
    $patchDefaultOptions
     = ['keepNull' => false, 'mergeObjects' => true, 'waitForSync' => true, 'ignoreRevs' => true, 'returnOld' => false, 'returnNew' => true]
    
    
    
    
    
$revision
Document revision
        protected
            string
    $revision
     = ''
    
    
    
    
    
$updateDefaultOptions
Default update options
        protected
            array<string|int, mixed>
    $updateDefaultOptions
     = ['waitForSync' => true, 'ignoreRevs' => true, 'returnOld' => false, 'returnNew' => true, 'silent' => false]
    
    
    
    
    
$validator
Validate primitive types
        protected
            RuleInterface
    $validator
    
    
    
    
    
    
Methods
__construct()
Document constructor.
    public
                    __construct([array<string|int, mixed> $attributes = [] ][, Collection $collection = null ]) : mixed
    Parameters
- $attributes : array<string|int, mixed> = []
- 
                    Document attributes 
- $collection : Collection = null
- 
                    Collection to add this document 
Tags
__get()
Get some attribute.
    public
                    __get(string $name) : mixed|null
    Parameters
- $name : string
- 
                    Attribute name. 
Return values
mixed|null —Attribute value.
__isset()
Verifies if an attribute is set on document
    public
                    __isset(string $name) : bool
    Parameters
- $name : string
Return values
bool__set()
Set a attribute
    public
                    __set(string $name, mixed $value) : mixed
    Parameters
- $name : string
- $value : mixed
Tags
__toString()
Return a string representation of document.
    public
                    __toString() : string
    Return values
string__unset()
Unset the given attribute of document
    public
                    __unset(string $name) : mixed
    Parameters
- $name : string
delete()
Removes a document on server, if possible
    public
                    delete() : bool
    Tags
Return values
bool —true if operation was successful, false otherwise
getCollection()
Returns the document collection
    public
                    getCollection() : Collection|null
    Return values
Collection|null —Collection object if is set. Null otherwise.
getId()
Returns the document Id
    public
                    getId() : string|null
    Return values
string|null —String if document already exists. Null otherwise (e.g. a new document)
getKey()
Returns the document key
    public
                    getKey() : string|null
    Return values
string|null —String if document already exists. Null otherwise (e.g. a new document)
getRevision()
Returns the document revision
    public
                    getRevision() : string|null
    Return values
string|null —String if document already exists. Null otherwise (e.g. a new document)
isNew()
Returns true if is a new object
    public
                    isNew() : bool
    Return values
booljsonSerialize()
    public
                    jsonSerialize() : array<string|int, mixed>|mixed
    Tags
Return values
array<string|int, mixed>|mixedsave()
Save or update the document, if possible
    public
                    save([array<string|int, mixed> $options = [] ]) : bool
    Parameters
- $options : array<string|int, mixed> = []
- 
                    Optional array of options. Only used on update operations. 
Tags
Return values
bool —true if operation was successful. Throws an exceptions otherwise
setCollection()
Sets the collection to add this document
    public
                    setCollection(Collection $collection) : void
    Parameters
- $collection : Collection
toArray()
Returns a array representation of document
    public
                    toArray() : array<string|int, mixed>
    Return values
array<string|int, mixed>setDescriptors()
Set document descriptors
    protected
                    setDescriptors(array<string|int, mixed> $descriptors) : void
    Parameters
- $descriptors : array<string|int, mixed>
update()
Update the document.
    protected
                    update([array<string|int, mixed> $options = [] ]) : bool
    Parameters
- $options : array<string|int, mixed> = []