DatabaseList.php 1.0 KB

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