Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. class Prof {
  2. public function modifCours($name, $desc, $student, $time) {
  3. //Code de modif de cours
  4. }
  5. }
  6.  
  7. class Modo {
  8. public function modifCours($name, $desc, $student, $time) {
  9. //On appel la méthode du prof pour modif les cours
  10. Prof::modifcours($name, $desc, $student, $time);
  11. }
  12.  
  13. public function changeLvl(int $id_membre, int $level) {
  14. if (!$this->_checkLevel($level) {
  15. throw new Exception('Level ' . $level . ' isn't correct!');
  16. }
  17. //Code
  18. }
  19.  
  20. private function _checkLevel($level) {
  21. if ($level < 2 || $level > 3)
  22. return false;
  23. return true;
  24. }
  25. }
  26.  
  27. class Admin extends Modo {
  28. public function checkAccess($id_membre) {
  29. //Code
  30. }
  31.  
  32. private function _checkLevel($level) {
  33. if ($level < 0 || $level > 3)
  34. return false;
  35. return true;
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement