@@ 8-75 (lines=68) @@ | ||
5 | /** |
|
6 | * @author Adrien Brault <[email protected]> |
|
7 | */ |
|
8 | class Route |
|
9 | { |
|
10 | /** |
|
11 | * @var string |
|
12 | */ |
|
13 | private $name; |
|
14 | ||
15 | /** |
|
16 | * @var string|array |
|
17 | */ |
|
18 | private $parameters; |
|
19 | ||
20 | /** |
|
21 | * @var boolean |
|
22 | */ |
|
23 | private $absolute; |
|
24 | ||
25 | /** |
|
26 | * @var null|string |
|
27 | */ |
|
28 | private $generator; |
|
29 | ||
30 | /** |
|
31 | * @param string $name |
|
32 | * @param string|array $parameters |
|
33 | * @param boolean $absolute |
|
34 | * @param string|null $generator |
|
35 | */ |
|
36 | public function __construct($name, $parameters = array(), $absolute = false, $generator = null) |
|
37 | { |
|
38 | $this->name = $name; |
|
39 | $this->parameters = $parameters; |
|
40 | $this->absolute = $absolute; |
|
41 | $this->generator = $generator; |
|
42 | } |
|
43 | ||
44 | /** |
|
45 | * @return string |
|
46 | */ |
|
47 | public function getName() |
|
48 | { |
|
49 | return $this->name; |
|
50 | } |
|
51 | ||
52 | /** |
|
53 | * @return string|array |
|
54 | */ |
|
55 | public function getParameters() |
|
56 | { |
|
57 | return $this->parameters; |
|
58 | } |
|
59 | ||
60 | /** |
|
61 | * @return boolean |
|
62 | */ |
|
63 | public function isAbsolute() |
|
64 | { |
|
65 | return $this->absolute; |
|
66 | } |
|
67 | ||
68 | /** |
|
69 | * @return null|string |
|
70 | */ |
|
71 | public function getGenerator() |
|
72 | { |
|
73 | return $this->generator; |
|
74 | } |
|
75 | } |
|
76 |
@@ 22-84 (lines=63) @@ | ||
19 | * |
|
20 | * @author Adrien Brault <[email protected]> |
|
21 | */ |
|
22 | class RouteAwareRepresentation |
|
23 | { |
|
24 | /** |
|
25 | * @Serializer\Inline |
|
26 | * @Serializer\Expose |
|
27 | */ |
|
28 | private $inline; |
|
29 | ||
30 | /** |
|
31 | * @var string |
|
32 | */ |
|
33 | private $route; |
|
34 | ||
35 | /** |
|
36 | * @var array |
|
37 | */ |
|
38 | private $parameters; |
|
39 | ||
40 | /** |
|
41 | * @var boolean |
|
42 | */ |
|
43 | private $absolute; |
|
44 | ||
45 | public function __construct($inline, $route, array $parameters = array(), $absolute = false) |
|
46 | { |
|
47 | $this->inline = $inline; |
|
48 | $this->route = $route; |
|
49 | $this->parameters = $parameters; |
|
50 | $this->absolute = $absolute; |
|
51 | } |
|
52 | ||
53 | /** |
|
54 | * @return mixed |
|
55 | */ |
|
56 | public function getInline() |
|
57 | { |
|
58 | return $this->inline; |
|
59 | } |
|
60 | ||
61 | /** |
|
62 | * @return string |
|
63 | */ |
|
64 | public function getRoute() |
|
65 | { |
|
66 | return $this->route; |
|
67 | } |
|
68 | ||
69 | /** |
|
70 | * @return array |
|
71 | */ |
|
72 | public function getParameters() |
|
73 | { |
|
74 | return $this->parameters; |
|
75 | } |
|
76 | ||
77 | /** |
|
78 | * @return boolean |
|
79 | */ |
|
80 | public function isAbsolute() |
|
81 | { |
|
82 | return $this->absolute; |
|
83 | } |
|
84 | } |
|
85 |