[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/src/Tree/ -> ImmutableNodeInterface.php (source)

   1  <?php
   2  
   3  /**
   4   * Joomla! Content Management System
   5   *
   6   * @copyright  (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
   7   * @license    GNU General Public License version 2 or later; see LICENSE.txt
   8   */
   9  
  10  namespace Joomla\CMS\Tree;
  11  
  12  // phpcs:disable PSR1.Files.SideEffects
  13  \defined('JPATH_PLATFORM') or die;
  14  // phpcs:enable PSR1.Files.SideEffects
  15  
  16  /**
  17   * Interface for an immutable node class
  18   *
  19   * @since  4.0.0
  20   */
  21  interface ImmutableNodeInterface
  22  {
  23      /**
  24       * Get the children of this node
  25       *
  26       * @param   boolean  $recursive  False by default
  27       *
  28       * @return  NodeInterface[]  The children
  29       *
  30       * @since   4.0.0
  31       */
  32      public function &getChildren($recursive = false);
  33  
  34      /**
  35       * Get the parent of this node
  36       *
  37       * @return  NodeInterface|null
  38       *
  39       * @since   4.0.0
  40       */
  41      public function getParent();
  42  
  43      /**
  44       * Get the root of the tree
  45       *
  46       * @return  ImmutableNodeInterface
  47       *
  48       * @since   4.0.0
  49       */
  50      public function getRoot();
  51  
  52      /**
  53       * Test if this node has children
  54       *
  55       * @return  boolean  True if there is a child
  56       *
  57       * @since   4.0.0
  58       */
  59      public function hasChildren();
  60  
  61      /**
  62       * Test if this node has a parent
  63       *
  64       * @return  boolean  True if there is a parent
  65       *
  66       * @since   4.0.0
  67       */
  68      public function hasParent();
  69  
  70      /**
  71       * Returns the right or left sibling of a node
  72       *
  73       * @param   boolean  $right  If set to false, returns the left sibling
  74       *
  75       * @return  NodeInterface|null  NodeInterface object of the sibling.
  76       *
  77       * @since   4.0.0
  78       */
  79      public function getSibling($right = true);
  80  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer