forked from pablodip/PablodipModuleBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModuleInterface.php
More file actions
181 lines (159 loc) · 4.01 KB
/
Copy pathModuleInterface.php
File metadata and controls
181 lines (159 loc) · 4.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<?php
/*
* This file is part of the PablodipModuleBundle package.
*
* (c) Pablo Díez <pablodip@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Pablodip\ModuleBundle\Module;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* ModuleInterface.
*
* @author Pablo Díez <pablodip@gmail.com>
*/
interface ModuleInterface
{
/**
* Constructor.
*
* @param ContainerInterface $container A container.
*/
function __construct(ContainerInterface $container);
/**
* Returns the container.
*
* @return ContainerInterface The container.
*/
function getContainer();
/**
* Returns an extension by name.
*
* @param string $name The name.
*
* @return ExtensionInterface The extension.
*
* @throws \InvalidArgumentException If the exception does not exist.
*/
function getExtension($name);
/**
* Returns the extensions.
*
* @return array The extensions.
*/
function getExtensions();
/**
* Returns the route name prefix.
*
* @return string The route name prefix.
*/
function getRouteNamePrefix();
/**
* Returns the route pattern prefix.
*
* @return string The route pattern prefix.
*/
function getRoutePatternPrefix();
/**
* Returns the parameters to propagate.
*
* @return array The parameters to propagate.
*/
function getParametersToPropagate();
/**
* Returns whether an option exists or not.
*
* @param string $name The name.
*
* @return Boolean Whether the option exists or not.
*/
function hasOption($name);
/**
* Returns an option value by name.
*
* @param string $name The name.
*
* @return mixed The option value.
*
* @throws \InvalidArgumentException If the option does not exist.
*/
function getOption($name);
/**
* Returns the options.
*
* @return array The options.
*/
function getOptions();
/**
* Returns whether an action exists.
*
* @param string $name The name.
*
* @return Boolean Whether the action exists.
*/
function hasAction($name);
/**
* Returns an action.
*
* @param string $name The name.
*
* @return ActionInterface The action.
*
* @throws \InvalidArgumentException If the action does not exist.
*/
function getAction($name);
/**
* Deletes an action.
*
* @param string $name The name.
*
* @throws \InvalidArgumentException If the action does not exist.
*/
function deleteAction($name);
/**
* Returns the actions.
*
* @return array An array of actions.
*/
function getActions();
/**
* Returns the route actions.
*
* @return array The route actions;
*/
function getRouteActions();
/**
* Returns the controller pre executes.
*
* @return array The controller pre executes.
*/
function getControllerPreExecutes();
/**
* Generates a module url.
*
* @param string $actionName The action name.
* @param array $parameters An array of parameters.
* @param Boolean $absolute Whether to generate an absolute url or not.
*
* @return string The url.
*/
function generateModuleUrl($actionName, array $parameters = array(), $absolute = false);
/**
* Forwards the request to an action.
*
* @param string $actionName The action name.
* @param array $attributes An array of attributes (optional).
* @param array $query An array of query parameters (optional).
*
* @return Response A response.
*/
function forward($actionName, array $attributes = array(), array $query = array());
/**
* Returns a module view with the module.
*
* @return ModuleView A module view.
*/
function createView();
}