4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Routing
;
15 * CompiledRoutes are returned by the RouteCompiler class.
17 * @author Fabien Potencier <fabien@symfony.com>
23 private $staticPrefix;
25 private $pathVariables;
26 private $hostVariables;
33 * @param string $staticPrefix The static prefix of the compiled route
34 * @param string $regex The regular expression to use to match this route
35 * @param array $tokens An array of tokens to use to generate URL for this route
36 * @param array $pathVariables An array of path variables
37 * @param string|null $hostRegex Host regex
38 * @param array $hostTokens Host tokens
39 * @param array $hostVariables An array of host variables
40 * @param array $variables An array of variables (variables defined in the path and in the host patterns)
42 public function __construct($staticPrefix, $regex, array $tokens, array $pathVariables, $hostRegex = null, array $hostTokens = array(), array $hostVariables = array(), array $variables = array())
44 $this->staticPrefix
= (string) $staticPrefix;
45 $this->regex
= $regex;
46 $this->tokens
= $tokens;
47 $this->pathVariables
= $pathVariables;
48 $this->hostRegex
= $hostRegex;
49 $this->hostTokens
= $hostTokens;
50 $this->hostVariables
= $hostVariables;
51 $this->variables
= $variables;
55 * Returns the static prefix.
57 * @return string The static prefix
59 public function getStaticPrefix()
61 return $this->staticPrefix
;
67 * @return string The regex
69 public function getRegex()
75 * Returns the host regex
77 * @return string|null The host regex or null
79 public function getHostRegex()
81 return $this->hostRegex
;
87 * @return array The tokens
89 public function getTokens()
95 * Returns the host tokens.
97 * @return array The tokens
99 public function getHostTokens()
101 return $this->hostTokens
;
105 * Returns the variables.
107 * @return array The variables
109 public function getVariables()
111 return $this->variables
;
115 * Returns the path variables.
117 * @return array The variables
119 public function getPathVariables()
121 return $this->pathVariables
;
125 * Returns the host variables.
127 * @return array The variables
129 public function getHostVariables()
131 return $this->hostVariables
;