Verzeichnisstruktur phpBB-3.3.15


Veröffentlicht
28.08.2024

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

tree_interface.php

Zuletzt modifiziert: 02.04.2025, 15:02 - Dateigröße: 3.71 KiB


001  <?php
002  /**
003  *
004  * This file is part of the phpBB Forum Software package.
005  *
006  * @copyright (c) phpBB Limited <https://www.phpbb.com>
007  * @license GNU General Public License, version 2 (GPL-2.0)
008  *
009  * For full copyright and license information, please see
010  * the docs/CREDITS.txt file.
011  *
012  */
013   
014  namespace phpbb\tree;
015   
016  interface tree_interface
017  {
018      /**
019      * Inserts an item into the database table and into the tree.
020      *
021      * @param array    $additional_data    The item to be added
022      * @return array Array with item data as set in the database
023      */
024      public function insert(array $additional_data);
025   
026      /**
027      * Delete an item from the tree and from the database table
028      *
029      * Also deletes the subtree from the tree and from the database table
030      *
031      * @param int    $item_id    The item to be deleted
032      * @return array        Item ids that have been deleted
033      */
034      public function delete($item_id);
035   
036      /**
037      * Move an item by a given delta
038      *
039      * An item is only moved up/down within the same parent. If the delta is
040      * larger then the number of children, the item is moved to the top/bottom
041      * of the list of children within this parent.
042      *
043      * @param int    $item_id    The item to be moved
044      * @param int    $delta        Number of steps to move this item, < 0 => down, > 0 => up
045      * @return bool True if the item was moved
046      */
047      public function move($item_id, $delta);
048   
049      /**
050      * Move an item down by 1
051      *
052      * @param int    $item_id    The item to be moved
053      * @return bool True if the item was moved
054      */
055      public function move_down($item_id);
056   
057      /**
058      * Move an item up by 1
059      *
060      * @param int    $item_id    The item to be moved
061      * @return bool True if the item was moved
062      */
063      public function move_up($item_id);
064   
065      /**
066      * Moves all children of one item to another item
067      *
068      * If the new parent already has children, the new children are appended
069      * to the list.
070      *
071      * @param int    $current_parent_id    The current parent item
072      * @param int    $new_parent_id        The new parent item
073      * @return bool True if any items where moved
074      */
075      public function move_children($current_parent_id, $new_parent_id);
076   
077      /**
078      * Change parent item
079      *
080      * Moves the item to the bottom of the new \parent's list of children
081      *
082      * @param int    $item_id            The item to be moved
083      * @param int    $new_parent_id        The new parent item
084      * @return bool True if the parent was set successfully
085      */
086      public function change_parent($item_id, $new_parent_id);
087   
088      /**
089      * Get all items that are either ancestors or descendants of the item
090      *
091      * @param int        $item_id        Id of the item to retrieve the ancestors/descendants from
092      * @param bool        $order_asc        Order the items ascendingly (most outer ancestor first)
093      * @param bool        $include_item    Should the item matching the given item id be included in the list as well
094      * @return array            Array of items (containing all columns from the item table)
095      *                            ID => Item data
096      */
097      public function get_path_and_subtree_data($item_id, $order_asc, $include_item);
098   
099      /**
100      * Get all of the item's ancestors
101      *
102      * @param int        $item_id        Id of the item to retrieve the ancestors from
103      * @param bool        $order_asc        Order the items ascendingly (most outer ancestor first)
104      * @param bool        $include_item    Should the item matching the given item id be included in the list as well
105      * @return array            Array of items (containing all columns from the item table)
106      *                            ID => Item data
107      */
108      public function get_path_data($item_id, $order_asc, $include_item);
109   
110      /**
111      * Get all of the item's descendants
112      *
113      * @param int        $item_id        Id of the item to retrieve the descendants from
114      * @param bool        $order_asc        Order the items ascendingly
115      * @param bool        $include_item    Should the item matching the given item id be included in the list as well
116      * @return array            Array of items (containing all columns from the item table)
117      *                            ID => Item data
118      */
119      public function get_subtree_data($item_id, $order_asc, $include_item);
120  }
121