Return all of the section route rules

@param string   $format 'Craft'|'React'|'Vue'
@param int|null $siteId

@return array
185107
public function getAllRouteRules(string $format = 'Craft', $siteId = null): array
    {
        // Get all of the sections
        $sections = $this->getAllSectionRouteRules($format, $siteId);
        $categories = $this->getAllCategoryRouteRules($format, $siteId);
        $rules = $this->getRouteRules($siteId);

        return [
            'sections'   => $sections,
            'categories' => $categories,
            'rules'      => $rules,
        ];
    }
632462
public function getRouteRules($sideId = null, $incGlobalRules = true): array
    {
        return RouteMap::$plugin->routes->getRouteRules($sideId, $incGlobalRules);
    }
50372
public function getPerimetersConfiguration($siteId)
    {
        $perimetersConfiguration = array();
        foreach ($this->strategies as $strategy) {
            $perimetersConfiguration = array_merge(
                $perimetersConfiguration,
                array($strategy->getType() => $strategy->getPerimeterConfiguration($siteId))
            );
        }

        return $perimetersConfiguration;
    }
614949
public function actionGetRouteRules($siteId = null, $includeGlobal = true): Response
    {
        return $this->asJson(RouteMap::$plugin->routes->getRouteRules($siteId, $includeGlobal));
    }
481641
public function getBlockById(int $blockId, int $siteId = null)
    {
        /** @var SuperTableBlock|null $block */
        $block = Craft::$app->getElements()->getElementById($blockId, SuperTableBlockElement::class, $siteId);

        return $block;
    }
1317402
public function getParameters($format = self::FETCH_ASSOC) {

        if ( $format === self::FETCH_NUMERIC ) return array_values($this->signatures[$this->current_signature]["PARAMETERS"]);

        else return $this->signatures[$this->current_signature]["PARAMETERS"];

    }
415081
public function getAvailableActions($format)
    {
        $availables = [];

        foreach (array_filter($this->actions, function ($action) use ($format) {
            return $action->supports($format);
        }) as $action) {
            $schema = $action->getAction();
            $availables[$schema[0]][$schema[1]] = $this->explainAction($this->getActionName($action), $format);
        }

        return $availables;
    }
1133746
public function getLanguageBySite($siteId)
    {
        if ($this->hasLanguageBySite($siteId)) {
            return $this->languageBySites[self::SITE_ID_PREFIX.$siteId];
        }

        return null;
    }
836331
public function getDataBySiteIdAndPageId($siteId, $pageId)
	{
	    $select = $this->tableGateway->getSql()->select();
	     
	    $select->columns(array('*'));
	     
	    $select->where(array("s404_site_id" => $siteId, 's404_page_id' => $pageId));
	    $resultSet = $this->tableGateway->selectWith($select);
	     
	    return $resultSet;
	}
928930
public function findByParentAndSite($parentId, $siteId)
    {
        $qb = $this->createQueryBuilder();
        if ($parentId) {
            $qb->field('parent.$id')->equals(new \MongoId($parentId));
        }
        $qb->field('siteId')->equals($siteId);

        return $qb->getQuery()->execute();
     }
1277345
public function getActiveTheme($siteId)
    {
        $manager = $this->getEntityManager();
        $query   = $manager
            ->createQueryBuilder()
            ->select('t,s')
            ->from($this->_entity, 't')
            ->innerJoin('t.siteThemes', 's')
            ->where('s.siteId = :id')
            ->andWhere('s.isActive = 1')
            ->setParameter(':id', $siteId)
            ->setMaxResults(1)
            ->getQuery();

        try {
            return $query->getSingleResult(AbstractQuery::HYDRATE_OBJECT);
        } catch (NoResultException $e) {
            return false;
        } catch (NonUniqueResultException $e) {
            return false;
        }
    }
956793
public function findFolderTree($siteId)
    {
        $qa = $this->createAggregationQuery();
        $qa->match(array('siteId' => $siteId));
        $folders = $qa->getQuery()->aggregate()->toArray();

        if (empty($folders)) {
            return array();
        }

        $rootFolders = array_filter($folders, function($folder, $key) {
            if (isset($folder['parent'])) {
                return false;
            }
            return true;
        }, ARRAY_FILTER_USE_BOTH);

        $foldersToPlace = array_udiff($folders, $rootFolders, function($folder1, $folder2) {
            if ($folder1 === $folder2) {
                return 0;
            }
            return -1;
        });

        $tree = array();
        foreach ($rootFolders as $rootFolder) {
            $tree[] = array(
                'folder'   => $rootFolder,
                'children' => $this->getChildren($rootFolder, $foldersToPlace)
            );
        }

        return $tree;
    }
639073
protected function normalizeFormat($format, $route): array
    {
        // Normalize the URL
        $route['url'] = $this->normalizeUri($route['url']);
        // Transform the URLs depending on the format requested
        switch ($format) {
            // React & Vue routes have a leading / and {slug} -> :slug
            case $this::ROUTE_FORMAT_REACT:
            case $this::ROUTE_FORMAT_VUE:
                $matchRegEx = '`{(.*?)}`i';
                $replaceRegEx = ':$1';
                $route['url'] = preg_replace($matchRegEx, $replaceRegEx, $route['url']);
                // Add a leading /
                $route['url'] = '/'.ltrim($route['url'], '/');
                break;

            // Craft-style URLs don't need to be changed
            case $this::ROUTE_FORMAT_CRAFT:
            default:
                // Do nothing
                break;
        }

        return $route;
    }
197607
protected function getRouteInformation(Route $route, $filter, $namespace): ?array
    {
        $uri = $route->uri();
        $host = $route->domain();
        $name = $route->getName();
        $laroute = $route->getAction('laroute');

        switch ($filter) {
            case 'all':
                if ($laroute === false) {
                    return null;
                }
                break;
            case 'only':
                if ($laroute !== true) {
                    return null;
                }
                break;
        }

        return compact('host', 'uri', 'name');
    }
405788
public function actionGetCategoryRouteRules(string $category, string $format = 'Craft', $siteId = null): Response
    {
        return $this->asJson(RouteMap::$plugin->routes->getCategoryRouteRules($category, $format, $siteId));
    }
1204352
public function findBySite($siteId)
    {
        $qb = $this->createQueryBuilder();
        $qb->field('siteId')->equals($siteId);

        return $qb;
    }
1368711
public function getRuleList($domain = null)
    {
        $list = [];

        foreach ($this->rule as $ruleDomain => $rules) {
            foreach ($rules as $rule => $items) {
                foreach ($items as $item) {
                    $val['domain'] = $ruleDomain;

                    foreach (['method', 'rule', 'name', 'route', 'pattern', 'option'] as $param) {
                        $call = 'get' . $param;
                        $val[$param] = $item->$call();
                    }

                    $list[$ruleDomain][] = $val;
                }
            }
        }

        if ($domain) {
            return isset($list[$domain]) ? $list[$domain] : [];
        }

        return $list;
    }