Get current root line

@param   integer|null $uid Page UID

@return  array
976574
public static function getRootLine($uid = null)
    {
        if ($uid === null) {
            #################
            # Current rootline
            #################
            if (empty(self::$rootlineCache['__CURRENT__'])) {
                // Current rootline
                $rootline = $GLOBALS['TSFE']->tmpl->rootLine;

                // Filter rootline by siteroot
                $rootline = self::filterRootlineBySiteroot((array)$rootline);

                self::$rootlineCache['__CURRENT__'] = $rootline;
            }

            $ret = self::$rootlineCache['__CURRENT__'];
        } else {
            #################
            # Other rootline
            #################
            if (empty(self::$rootlineCache[$uid])) {
                // Fetch full rootline to TYPO3 root (0)
                $rootline = self::getSysPageObj()->getRootLine($uid);

                // Filter rootline by siteroot
                $rootline = self::filterRootlineBySiteroot((array)$rootline);

                self::$rootlineCache[$uid] = $rootline;
            }

            $ret = self::$rootlineCache[$uid];
        }

        return $ret;
    }
120690
public function getRules($uid){
        
        $ruleIds = $this->getRuleIds($uid);
        
        $rules = DB::table($this->dbTablePrefix . $this->tableAuthRule)
                ->where('id' , 'in' , $ruleIds)
                ->where('status' , '1')
                ->order('sort asc')
                ->select();
        
        return $rules;
    }
1101713
public function fetchTree($rootId=null, $depth=null)
    {
        $wrappers = $this->fetchTreeAsArray($rootId, $depth);

        return (!is_array($wrappers) || empty($wrappers)) ? null : $wrappers[0];
    }
1087419
public function getRuleData($uid) {

        if (empty($this->ruleData) && !empty($uid)){

            $rule_data = $this->config['auth_cache'] ? Cache::get($this->getRuleKey($uid)) : [];


            if (empty($rule_data) || !is_array($rule_data)){

                $join = '__AUTH_RULE__ b';

                $where = [];
                $groups = $this->getRoleUser($uid);
                $where['a.role_id'] = ['in',$groups];

                $where['b.status'] = 1;

                $rule_data = Db::name('auth_access')->alias("a")
                    ->field('b.name,b.condition')
                    ->join($join,'a.rule_name = b.name')
                    ->where($where)
                    ->select();

                if (empty($rule_data)) return false;

                if ($this->config['auth_cache'])
                    Cache::set($this->getRuleKey($uid),$rule_data);

            }

            $this->ruleData = $rule_data;

        }

        return $this->ruleData;
    }
1071518
protected function getSiteForRootPageId(int $pageId): array
    {
        return is_array($this->sites[$pageId]) ? $this->sites[$pageId] : [];
    }
869787
private function getFilter($uid)
    {
        if (isset($this->filters[$uid])) {
            return $this->filters[$uid];
        }

        $entry = $this->cache->get($this->getCacheId($uid));

        if ($entry && $entry->data instanceof BloomFilter) {
            return $this->filters[$uid] = $entry->data;
        }

        return $this->filters[$uid] = $this->rebuildFilter($uid);
    }
736887
public function tree($id = null)
    {
        $id = ($id == null) ? $this->root : $id;
        return $this->stack[$id];
    }
3533
protected function getSiteRootsByObservedPageIds($table, $uid)
    {
        $cacheId = 'RootPageResolver' . '_' . 'getSiteRootsByObservedPageIds' . '_' . $table . '_' . $uid;
        $methodResult = $this->runtimeCache->get($cacheId);
        if (!empty($methodResult)) {
            return $methodResult;
        }

        $methodResult = $this->buildSiteRootsByObservedPageIds($table, $uid);
        $this->runtimeCache->set($cacheId, $methodResult);

        return $methodResult;
    }
679313
public function getUserinfo($uid = null)
	{
		$ret = array();
		if (extension_loaded('posix')) {
			if (is_null($uid)) {
				$uid = posix_geteuid();	// get effective userid
			} elseif (is_string($uid)) {
				// username passed?
				$ret = posix_getpwnam($uid);
			}
			if (empty($ret)) {
				$ret = posix_getpwuid($uid);
			}
			$ret['group'] = posix_getgrgid($uid_info['gid']);
			unset($ret['gid']);	// is inside group array
		}
		return $ret;
	}
107364
public static function GetCurrentUser($guid = "CURRENT_USER")
	{
		if (self::$user == null)
		{
			self::Init();
			
			if (isset($_SESSION[$guid]))
			{
				self::$user = unserialize($_SESSION[$guid]);
			}		
		}
		return self::$user;
	}
209615
protected function getOwnerReference($uid) {
    $key = $uid . ':' . self::OWNER_REFERENCE_NAMESPACE;
    if (($object = $this->storage->get($key)) && ($object->owner == $uid)) {
      return $object->data;
    }
  }
829378
public static function resolvetoFIDtoURI(int $fid) {

        if (!is_integer($fid)) {
            return null;
        }
        /* @var \Drupal\file\FileInterface $file */
        $file = \Drupal::entityTypeManager()->getStorage('file')->load($fid);
        return $file;
    }
166118
protected function buildCategoryIdRootline($uid)
    {
        $rootlineIds = [];
        $parentCategory = intval($uid);

        while ($parentCategory !== 0) {
            $rootlineIds[] = $parentCategory;
            $childCategory = $this->systemCategoryRepository->findOneByUid($parentCategory);
            if ($childCategory === null) {
                $parentCategory = 0;
            } else {
                $parentCategory = intval($childCategory['parent']);
            }
        }
        krsort($rootlineIds);

        return array_values($rootlineIds);
    }
191148
public function getRoleUser($uid) {

        if (empty($this->roleUser)){

            $role_user_data = $this->config['auth_cache'] ? Session::get($this->getRoleUserKey()) : [];

            if (empty($role_user_data) || !is_array($role_user_data)){

                $where = [];
                $where['user_id'] = $uid;
                $role_user_list = Db::name($this->config['role_user'])
                    ->field('role_id')
                    ->where($where)
                    ->select();

                $role_user_data = array_column($role_user_list,'role_id');

                //dump($role_user_data);

                if (empty($role_user_data)) return false;

                if ($this->config['auth_cache'])
                    Session::set($this->getRoleUserKey(),$role_user_data);
            }

            $this->roleUser = $role_user_data;

        }

        return $this->roleUser;
    }
460330
protected function getDomainRecordsByRootPageIds(array $rootPageIds = [])
    {
        $queryBuilder = $this->getQueryBuilder();

        return $queryBuilder->select('uid', 'pid')
            ->from($this->table)
            ->where(
                $queryBuilder->expr()->in('pid', $rootPageIds)
            )->groupBy('uid', 'pid', 'sorting')
            ->orderBy('pid')
            ->addOrderBy('sorting')
            ->execute()->fetchAll();
    }
1302070
public function findContentByUid($uid)
    {
        $results = $this->findContentsByUids(array($uid));
        if (0 < count($results)) {
            return reset($results);
        }

        return;
    }
361175
public function getPage(int $uid, int $languageUid = null) {
    $page   = null;
    $record = $this->pageRepository->getPage($uid);

    if (is_array($record) && !empty($record)) {
      if (in_array($record['doktype'], self::PAGE_DOKTYPES)) {
        $page        = $record;
        $languageUid = isset($languageUid) ? $languageUid : $this->languageService->getLanguageUid();

        if ($languageUid > 0) {
          $page = $this->pageRepository->getPageOverlay($page, $languageUid);
        }
      }
    }

    return $page;
  }