public function getSubpagesUids(int $pid, int $recursion = 1, bool $exclude = true): array {
    $subpagesUids = [];
    $treeList     = $this->queryGenerator->getTreeList($pid, $recursion, 0, 1);
    $recordUids   = GeneralUtility::intExplode(',', $treeList, true);

    if ($recordUids) {
      foreach ($recordUids as $recordUid) {
        if ($this->getPage($recordUid)) {
          $subpagesUids[] = $recordUid;
        }
      }
    }

    if ($exclude) {
      unset($subpagesUids[0]);
    }

    return $subpagesUids;
  }