context : create two records, the second has a LINK property named "friend" pointing to the first record
question : how to fetch both records, in one query, only knowing the second record's RID ?
<?php
use PhpOrient\PhpOrient;
use PhpOrient\Protocols\Binary\Data\Record;
$client = new PhpOrient('localhost', 2424);
$client->dbOpen('test', 'root', 'root'); // a Graph database
$me = $client->recordCreate(Record::fromConfig(['oClass' => 'V', 'oData' => ['label' => 'me']]));
$you = $client->recordCreate(Record::fromConfig(['oClass' => 'V', 'oData' => ['label' => 'you', 'friend' => ''.$me->getRid()]]));
<?php
// and later, only knowing the $youRecordRid
$records = $client->query("??? {$youRecordRid} ???"); // or any thing else but in one query
assert(count($records) == 2);
context : create two records, the second has a LINK property named "friend" pointing to the first record
question : how to fetch both records, in one query, only knowing the second record's RID ?