Continued:
[core.git] / framework / main / interfaces / request / class_Requestable.php
1 <?php
2 // Own namespace
3 namespace Org\Mxchange\CoreFramework\Request;
4
5 // Import framework stuff
6 use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
7
8 /**
9  * An interface for requests
10  *
11  * @author              Roland Haeder <webmaster@shipsimu.org>
12  * @version             0.0.0
13  * @copyright   Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2019 Core Developer Team
14  * @license             GNU GPL 3.0 or any newer version
15  * @link                http://www.shipsimu.org
16  *
17  * This program is free software: you can redistribute it and/or modify
18  * it under the terms of the GNU General Public License as published by
19  * the Free Software Foundation, either version 3 of the License, or
20  * (at your option) any later version.
21  *
22  * This program is distributed in the hope that it will be useful,
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
25  * GNU General Public License for more details.
26  *
27  * You should have received a copy of the GNU General Public License
28  * along with this program. If not, see <http://www.gnu.org/licenses/>.
29  */
30 interface Requestable extends FrameworkInterface {
31         /**
32          * Checks whether a request element is set
33          *
34          * @param       $element        Name of the request element we want to check
35          * @return      $isSet          Whether the request element is set
36          */
37         function isRequestElementSet ($element);
38
39         /**
40          * Getter for request element or 'null' if element was not found
41          *
42          * @param       $element        Name of the request element we want to check
43          * @return      $value          Value of the found request element or 'null' if the
44          *                                              element was not found
45          */
46         function getRequestElement ($element);
47
48         /**
49          * Setter for request elements
50          *
51          * @param       $element        Request element to se
52          * @param       $value          Value to set
53          * @return      void
54          */
55         function setRequestElement ($element, $value);
56
57         /**
58          * Setter for request data array
59          *
60          * @param       $requestData    Request element to se
61          * @return      void
62          */
63         function setRequestData (array $requestData);
64
65         /**
66          * Wrapper method for array_key() function for the request data array
67          *
68          * @return      $array  An array containing all array keys to return
69          */
70         function getParameterNames ();
71
72         /**
73          * Sets whether the request was valid (default: true)
74          *
75          * @param       $isValid        Whether the request is valid
76          * @return      void
77          */
78         function requestIsValid ($isValid = true);
79
80         /**
81          * Returns whether this request is valid
82          *
83          * @return      $requestIsValid         Whether this request is valid
84          */
85         function isRequestValid ();
86
87 }