Oihana PHP Arango

edgeEndKey.php

Table of Contents

Functions

edgeEndKey()  : string|null
Returns the `_key` of one end of an edge (`_from` or `_to`).

Functions

edgeEndKey()

Returns the `_key` of one end of an edge (`_from` or `_to`).

edgeEndKey(mixed $edge, string $end) : string|null

Accepts the edge as an object or as an associative array, as the edge models return it. The end is read as a document handle (<collection>/<key>) and reduced to its _key by parseKey().

Parameters
$edge : mixed

The edge : an object, an array, or anything else (answers null).

$end : string

The end to read : Schema::_FROM or Schema::_TO.

Tags
example
use org\schema\constants\Schema ;

edgeEndKey( [ '_from' => 'roles/42' , '_to' => 'permissions/7' ] , Schema::_FROM ) ; // '42'
edgeEndKey( (object) [ '_to' => 'policies/p1' ] , Schema::_TO )                    ; // 'p1'
edgeEndKey( (object) [] , Schema::_FROM )                                          ; // null
see
edgeEndKeys()

The distinct keys of one end of a list of edges.

author

Marc Alcaraz

Return values
string|null —

The _key of that end, or null when the edge has no such end, or a non-string one.

On this page

Search results