knasenn /
proj-ramv1
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Aiur18\getset; |
||
| 4 | |||
| 5 | |||
| 6 | |||
| 7 | /** |
||
| 8 | * A database driven model using the Active Record design pattern. |
||
| 9 | */ |
||
| 10 | class getset |
||
| 11 | { |
||
| 12 | |||
| 13 | |||
| 14 | /** Method |
||
| 15 | */ |
||
| 16 | function getGet($key) |
||
|
0 ignored issues
–
show
|
|||
| 17 | { |
||
| 18 | if (isset($_GET[$key])) { |
||
| 19 | return $_GET[$key]; |
||
| 20 | } |
||
| 21 | } |
||
| 22 | |||
| 23 | |||
| 24 | /** Method |
||
| 25 | */ |
||
| 26 | function setGet($key, $value) |
||
|
0 ignored issues
–
show
|
|||
| 27 | { |
||
| 28 | if ($key != null && $value != null) { |
||
| 29 | $_GET[$key] = $value; |
||
| 30 | } |
||
| 31 | } |
||
| 32 | |||
| 33 | |||
| 34 | /** Method |
||
| 35 | */ |
||
| 36 | function getPost($key) |
||
|
0 ignored issues
–
show
|
|||
| 37 | { |
||
| 38 | if (isset($_POST[$key])) { |
||
| 39 | return $_POST[$key]; |
||
| 40 | } |
||
| 41 | } |
||
| 42 | |||
| 43 | |||
| 44 | /** Method |
||
| 45 | */ |
||
| 46 | function setPost($key, $value) |
||
|
0 ignored issues
–
show
|
|||
| 47 | { |
||
| 48 | if ($key != null && $value != null) { |
||
| 49 | $_POST[$key] = $value; |
||
| 50 | } |
||
| 51 | } |
||
| 52 | |||
| 53 | /** Method |
||
| 54 | */ |
||
| 55 | function getServer($key) |
||
|
0 ignored issues
–
show
|
|||
| 56 | { |
||
| 57 | if (isset($_SESSION[$key])) { |
||
| 58 | return $_SESSION[$key]; |
||
| 59 | } |
||
| 60 | } |
||
| 61 | |||
| 62 | |||
| 63 | /** Method |
||
| 64 | */ |
||
| 65 | function setServer($key, $value) |
||
|
0 ignored issues
–
show
|
|||
| 66 | { |
||
| 67 | if ($key != null && $value != null) { |
||
| 68 | $_SESSION[$key] = $value; |
||
| 69 | } |
||
| 70 | } |
||
| 71 | |||
| 72 | /** |
||
| 73 | * Method |
||
| 74 | */ |
||
| 75 | public function logoutSession() |
||
| 76 | { |
||
| 77 | session_destroy(); |
||
| 78 | session_start(); |
||
| 79 | } |
||
| 80 | |||
| 81 | } |
||
| 82 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.