NodeDatabaseChildContainer.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * Represents container node that carries children of a database
  5. *
  6. * @package PhpMyAdmin-Navigation
  7. */
  8. declare(strict_types=1);
  9. namespace PhpMyAdmin\Navigation\Nodes;
  10. /**
  11. * Represents container node that carries children of a database
  12. *
  13. * @package PhpMyAdmin-Navigation
  14. */
  15. abstract class NodeDatabaseChildContainer extends NodeDatabaseChild
  16. {
  17. /**
  18. * Initialises the class by setting the common variables
  19. *
  20. * @param string $name An identifier for the new node
  21. * @param int $type Type of node, may be one of CONTAINER or OBJECT
  22. */
  23. public function __construct($name, $type = Node::OBJECT)
  24. {
  25. parent::__construct($name, $type);
  26. if ($GLOBALS['cfg']['NavigationTreeEnableGrouping']) {
  27. $this->separator = $GLOBALS['cfg']['NavigationTreeTableSeparator'];
  28. $this->separatorDepth = (int) $GLOBALS['cfg']['NavigationTreeTableLevel'];
  29. }
  30. }
  31. /**
  32. * Returns the type of the item represented by the node.
  33. *
  34. * @return string type of the item
  35. */
  36. protected function getItemType()
  37. {
  38. return 'group';
  39. }
  40. }