Пример #1
0
    array_walk($links, $callback);
    try {
        $db->recordUpdate('2:' . $rand_record, 'Name:"Bill",Id:' . $i . ', map:[' . implode(',', $links) . ']');
        $linked_records[] = $rand_record;
    } catch (OrientDBException $e) {
        echo $e->getMessage() . PHP_EOL;
    }
}
echo 'Done update ' . $records . PHP_EOL;
echo microtime(true) - $time_c . PHP_EOL;
$time_c = microtime(true);
$record = $db->recordLoad('2:' . $result[count($result) - 1], '*:-1');
echo 'Done get last' . PHP_EOL;
echo microtime(true) - $time_c . PHP_EOL;
$time_c = microtime(true);
$db->setDebug(true);
try {
    $record = $db->recordLoad('2:' . $linked_records[count($linked_records) - 1], '*:10');
} catch (OrientDBException $e) {
    echo $e->getMessage() . PHP_EOL;
}
$db->setDebug(false);
echo 'Done get linked' . PHP_EOL;
echo microtime(true) - $time_c . PHP_EOL;
var_dump($record->content);
$time_c = microtime(true);
for ($i = 0; $i < count($result); $i++) {
    try {
        $db->recordDelete('2:' . $result[$i]);
    } catch (OrientDBException $e) {
        echo $e->getMessage() . PHP_EOL;