Verzeichnisstruktur phpBB-3.1.0
- Veröffentlicht
- 27.10.2014
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
Route.php
001 <?php
002
003 /*
004 * This file is part of the Symfony package.
005 *
006 * (c) Fabien Potencier <fabien@symfony.com>
007 *
008 * For the full copyright and license information, please view the LICENSE
009 * file that was distributed with this source code.
010 */
011
012 namespace Symfony\Component\Routing\Annotation;
013
014 /**
015 * Annotation class for @Route().
016 *
017 * @Annotation
018 * @Target({"CLASS", "METHOD"})
019 *
020 * @author Fabien Potencier <fabien@symfony.com>
021 */
022 class Route
023 {
024 private $path;
025 private $name;
026 private $requirements;
027 private $options;
028 private $defaults;
029 private $host;
030 private $methods;
031 private $schemes;
032
033 /**
034 * Constructor.
035 *
036 * @param array $data An array of key/value parameters.
037 *
038 * @throws \BadMethodCallException
039 */
040 public function __construct(array $data)
041 {
042 $this->requirements = array();
043 $this->options = array();
044 $this->defaults = array();
045 $this->methods = array();
046 $this->schemes = array();
047
048 if (isset($data['value'])) {
049 $data['path'] = $data['value'];
050 unset($data['value']);
051 }
052
053 foreach ($data as $key => $value) {
054 $method = 'set'.str_replace('_', '', $key);
055 if (!method_exists($this, $method)) {
056 throw new \BadMethodCallException(sprintf("Unknown property '%s' on annotation '%s'.", $key, get_class($this)));
057 }
058 $this->$method($value);
059 }
060 }
061
062 /**
063 * @deprecated Deprecated in 2.2, to be removed in 3.0. Use setPath instead.
064 */
065 public function setPattern($pattern)
066 {
067 $this->path = $pattern;
068 }
069
070 /**
071 * @deprecated Deprecated in 2.2, to be removed in 3.0. Use getPath instead.
072 */
073 public function getPattern()
074 {
075 return $this->path;
076 }
077
078 public function setPath($path)
079 {
080 $this->path = $path;
081 }
082
083 public function getPath()
084 {
085 return $this->path;
086 }
087
088 public function setHost($pattern)
089 {
090 $this->host = $pattern;
091 }
092
093 public function getHost()
094 {
095 return $this->host;
096 }
097
098 public function setName($name)
099 {
100 $this->name = $name;
101 }
102
103 public function getName()
104 {
105 return $this->name;
106 }
107
108 public function setRequirements($requirements)
109 {
110 $this->requirements = $requirements;
111 }
112
113 public function getRequirements()
114 {
115 return $this->requirements;
116 }
117
118 public function setOptions($options)
119 {
120 $this->options = $options;
121 }
122
123 public function getOptions()
124 {
125 return $this->options;
126 }
127
128 public function setDefaults($defaults)
129 {
130 $this->defaults = $defaults;
131 }
132
133 public function getDefaults()
134 {
135 return $this->defaults;
136 }
137
138 public function setSchemes($schemes)
139 {
140 $this->schemes = is_array($schemes) ? $schemes : array($schemes);
141 }
142
143 public function getSchemes()
144 {
145 return $this->schemes;
146 }
147
148 public function setMethods($methods)
149 {
150 $this->methods = is_array($methods) ? $methods : array($methods);
151 }
152
153 public function getMethods()
154 {
155 return $this->methods;
156 }
157 }
158