DatabaseList.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * holds the PhpMyAdmin\Database\DatabaseList class
  5. *
  6. * @package PhpMyAdmin
  7. *
  8. */
  9. declare(strict_types=1);
  10. namespace PhpMyAdmin\Database;
  11. use PhpMyAdmin\ListDatabase;
  12. /**
  13. * holds the DatabaseList class
  14. *
  15. * @package PhpMyAdmin
  16. */
  17. class DatabaseList
  18. {
  19. /**
  20. * Holds database list
  21. *
  22. * @var ListDatabase
  23. */
  24. protected $databases = null;
  25. /**
  26. * magic access to protected/inaccessible members/properties
  27. *
  28. * @param string $param parameter name
  29. *
  30. * @return mixed
  31. * @see https://www.php.net/language.oop5.overloading
  32. */
  33. public function __get($param)
  34. {
  35. switch ($param) {
  36. case 'databases':
  37. return $this->getDatabaseList();
  38. }
  39. return null;
  40. }
  41. /**
  42. * Accessor to PMA::$databases
  43. *
  44. * @return ListDatabase
  45. */
  46. public function getDatabaseList()
  47. {
  48. if (null === $this->databases) {
  49. $this->databases = new ListDatabase();
  50. }
  51. return $this->databases;
  52. }
  53. }