You are here

protected function MongodbMenuTreeStorage::decode128 in MongoDB 8

Parameters

$encoded:

Return value

array

1 call to MongodbMenuTreeStorage::decode128()
MongodbMenuTreeStorage::getRootPathIds in src/MongodbMenuTreeStorage.php
Returns all the IDs that represent the path to the root of the tree.

File

src/MongodbMenuTreeStorage.php, line 218
Contains \Drupal\mongodb\MongodbMenuTreeStorage .

Class

MongodbMenuTreeStorage

Namespace

Drupal\mongodb

Code

protected function decode128($encoded) {
  $i = 0;
  $numbers = [];
  while (isset($encoded[$i])) {
    $number = 0;
    $current_end = $i + ord($encoded[$i]);
    for ($i++; $i <= $current_end; $i++) {
      $number = ($number << 7) + ord($encoded[$i]);
    }
    $numbers[] = $number;
  }
  return $numbers;
}