build

@param string $route
@param array  $queries
@param string $type

@return string
@throws \Psr\Cache\InvalidArgumentException
1571
public function route($route, $queries = [], $type = MainRouter::TYPE_PATH)
    {
        try {
            if ($this->router->hasRoute($this->package->getName() . '@' . $route)) {
                return $this->router->build($this->package->getName() . '@' . $route, $queries, $type);
            }

            return $this->router->build($route, $queries, $type);
        } catch (\OutOfRangeException $e) {
            if ($this->package->app->get('routing.debug', true)) {
                throw new \OutOfRangeException($e->getMessage(), $e->getCode(), $e);
            }

            return '#';
        }
    }
1169069
public static function load(
        array $routes, array $excludedUris = [], array $excludedMethods = [], array $methodColors = []
    ) {
        return static::make($routes)
            ->filter(function (IlluminateRoute $route) use ($excludedUris) {
                return ! Str::startsWith($route->uri(), $excludedUris);
            })
            ->transform(function (IlluminateRoute $route) use ($excludedMethods, $methodColors) {
                return new Route(
                    static::prepareMethods($route, $excludedMethods, $methodColors),
                    $route->uri(),
                    $route->getActionName(),
                    $route->getName(),
                    static::prepareMiddleware($route),
                    $route->domain()
                );
            });
    }
184300
private function build(string $type)
    {
        if (!in_array($type, ['public', 'local'])) {
            throw new \InvalidArgumentException('type accepts public or local');
        }
        if (!$this->called) {
            $url = $type === 'public' ? $this->config->env['public'] : $this->config->env['local'];
            $url = rtrim($url, '/');
            Util::clearDirectory($this->config->path('cache'));
            $articles        = ArticleGenerator::getArticles($this->config->path('article'), $url);
            $paths = $this->config->paths;
            $articles->each(function ($article) use ($paths) {
                $article->createCache("{$paths['cache']}/article");
            });
            $this->generator = new SiteGenerator($this->config, $articles);
            $this->called    = true;
        }
        Util::clearDirectory($this->config->path($type), true);
        $this->generator->generate($type);
    }
1147309
public function route($route, $query = [], $type = MainRouter::TYPE_PATH)
    {
        $this->route = [
            'route' => $route,
            'query' => (array) $query,
            'type' => $type,
        ];

        return $this;
    }
1112672
public function remove($route, $type = 'any')
    {
        if (isset($this->routes[$type][$route])) {
            unset($this->routes[$type][$route]);
        }
        return $this;
    }
823978
protected function buildRoute(Route $route)
    {
        if ($route->getBlock()) {
            return $route;
        }

        list($pattern, $params) = $this->parsePlaceholders($route->getPattern());
        return $route->setPatternWithoutReset($pattern)->setParams($params)->setBlock(true);
    }
956457
public function import($resource, $prefix = '/', $type = null)
    {
        /** @var RouteCollection[] $collections */
        $collections = $this->load($resource, $type);

        // create a builder from the RouteCollection
        $builder = $this->createBuilder();

        foreach ($collections as $collection) {
            if (null === $collection) {
                continue;
            }

            foreach ($collection->all() as $name => $route) {
                $builder->addRoute($route, $name);
            }

            foreach ($collection->getResources() as $resource) {
                $builder->addResource($resource);
            }
        }

        // mount into this builder
        $this->mount($prefix, $builder);

        return $builder;
    }
701636
public function set($route)
    {
        if (is_string($route)) {
            $this->routes[] = array(
                    'pattern' => $route
                ) + $this->routeOptions;
        } elseif (is_array($route)) {
            $this->routes[] = $route + $this->routeOptions;
        } else {
            throw new \InvalidArgumentException(sprintf(
                'Expected argument of type string or array, "%s" given',
                is_object($route) ? get_class($route) : gettype($route)
            ));
        }

        return $this;
    }
813851
public function route($route, $params = [])
    {
        $this->url(
            $this->container->make('url')->route($route, $params)
        );

        return $this;
    }
235109
public function build($query, $filter)
    {
        $parser = $this->getParser();
        $builder = $this->getBuilder();

        try {
            $builder->build($query, $parser->parse($filter));
        } catch (\Railken\SQ\Exceptions\QuerySyntaxException $e) {
            throw new \Railken\SQ\Exceptions\QuerySyntaxException($filter);
        }
    }
121463
public function getUrl($type, $path, $params = array()) {
        $url = self::$URL_TABLE[$type] . $path;
        if (!empty($params)) {
            $url .= '?' . http_build_query($params);
        }
        return $url;
    }
70714
public function compileRouter(RouteCollection $routes)
    {
        $routeTree = $this->treeBuilder->build($routes->asArray());
        $routeTree = $this->treeOptimizer->optimize($routeTree);

        $code         = new PhpBuilder();
        $code->indent = 1;
        $this->compileRouteTree($code, $routeTree);

        $rootRouteCode = new PhpBuilder();
        $rootRouteCode->indent = 2;
        if ($routeTree->hasRootRoute()) {
            $this->compiledRouteHttpMethodMatch($rootRouteCode, $routeTree->getRootRouteData(), array());
        } else {
            $this->compileNotFound($rootRouteCode);
        }

        return $this->formatPhpRouterTemplate(substr($rootRouteCode->getCode(), 0, -strlen(PHP_EOL)), $code->getCode());
    }
19893
public function buildSqlQuery(IndexQueryInterface $query, array $columns = null)
    {
        $queryString = sprintf("SELECT `%s` FROM `%s`", implode("`,`", $columns), $query->getName());

        if ("" !== $criteria = $this->buildSqlConditions($query)) {
            $queryString .= sprintf(" WHERE %s", $criteria);
        }

        if (null !== $limit = $query->getLimit()) {
            $queryString .= sprintf(" LIMIT %d", $limit);
        }

        return $queryString;
    }
419974
public function join($type, $table, array $relations = array())
    {
        $this->queryBuilder->join($type, $table, $relations);
        return $this;
    }
250157
protected function createRoute(RouteInterface $route, Request $request)
    {
        $routePath = $this->decodePathInfo($request->getPathInfo());

        if ($route->isHistory()) {
            return new Route(
                $routePath,
                [
                    '_controller' => 'SuluWebsiteBundle:Redirect:redirect',
                    'url' => $request->getSchemeAndHttpHost()
                        . $this->requestAnalyzer->getResourceLocatorPrefix()
                        . $route->getTarget()->getPath()
                        . ($request->getQueryString() ? ('?' . $request->getQueryString()) : ''),
                ]
            );
        }

        $symfonyRoute = $this->proxyFactory->createProxy(
            Route::class,
            function(&$wrappedObject, LazyLoadingInterface $proxy, $method, array $parameters, &$initializer) use (
                $routePath,
                $route,
                $request
            ) {
                $initializer = null; // disable initialization
                $wrappedObject = new Route(
                    $routePath,
                    $this->routeDefaultsProvider->getByEntity(
                        $route->getEntityClass(),
                        $route->getEntityId(),
                        $request->getLocale()
                    )
                );

                return true;
            }
        );

        return $this->symfonyRouteCache[$route->getId()] = $symfonyRoute;
    }
776536
private static function getQueriableResource($type, array $options = [])
    {
        if (!array_key_exists($type, self::$cache['resources']) || self::haveOptionsBeenUpdated($type, $options)) {
            self::$cache['options'][$type] = $options;
            self::$cache['resources'][$type] = new QueriableResource($type, $options);
        }
        return self::$cache['resources'][$type];
    }
86168
public function createGroup(array $routes = array(), Route $route = null)
    {
        return $this->create('group', array($this, $route, $routes));
    }