ILIAS  trunk Revision v12.0_alpha-1540-g00f839d5fa1
KSDocumentationTreeRecursion Class Reference

Tree Recursion, putting Entries into a Tree. More...

+ Inheritance diagram for KSDocumentationTreeRecursion:
+ Collaboration diagram for KSDocumentationTreeRecursion:

Public Member Functions

 __construct (Entries $entries, URI $parent_uri, string $current_opened_entry_id)
 
 getChildren ($record, $environment=null)
 
- Public Member Functions inherited from ILIAS\UI\Component\Tree\TreeRecursion
 getChildren ( $record, $environment=null)
 Get a list of records (that list can also be empty). More...
 
 build (Node\Factory $factory, $record, $environment=null)
 Build and return a Node. More...
 

Protected Member Functions

 getNodeUri (Entry $a_node)
 

Protected Attributes

Entries $entries
 
URI $parent_uri
 
Entry $current_node
 

Detailed Description

Tree Recursion, putting Entries into a Tree.

Definition at line 28 of file KSDocumentationTreeRecursion.php.

Constructor & Destructor Documentation

◆ __construct()

KSDocumentationTreeRecursion::__construct ( Entries  $entries,
URI  $parent_uri,
string  $current_opened_entry_id 
)

Definition at line 34 of file KSDocumentationTreeRecursion.php.

35 {
36 $this->entries = $entries;
37 $this->parent_uri = $parent_uri;
38 $this->current_node = $entries->getRootEntry();
39 if ($current_opened_entry_id) {
40 $this->current_node = $entries->getEntryById($current_opened_entry_id);
41 }
42 }

References $entries, and $parent_uri.

Member Function Documentation

◆ getChildren()

KSDocumentationTreeRecursion::getChildren (   $record,
  $environment = null 
)
Parameters
Entry$record
Returns
Entry[]

Implements ILIAS\UI\Component\Tree\TreeRecursion.

Definition at line 47 of file KSDocumentationTreeRecursion.php.

47 : array
48 {
49 $entries = $this->entries->getChildrenOfEntry($record->getId());
50 usort($entries, static fn(Entry $a, Entry $b): int => ilStr::strCmp($a->getTitle(), $b->getTitle()));
51 return $entries;
52 }
static strCmp(string $a, string $b)
Definition: class.ilStr.php:87
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples

References Vendor\Package\$a, Vendor\Package\$b, $entries, and ilStr\strCmp().

+ Here is the call graph for this function:

◆ getNodeUri()

KSDocumentationTreeRecursion::getNodeUri ( Entry  $a_node)
protected

Definition at line 72 of file KSDocumentationTreeRecursion.php.

72 : URI
73 {
74 return $this->parent_uri->withParameter('node_id', $a_node->getId());
75 }
The scope of this class is split ilias-conform URI's into components.
Definition: URI.php:35
withParameter(string $key, $value)
Get URI with modified parameters.
Definition: URI.php:387

References ILIAS\Data\URI\withParameter().

+ Here is the call graph for this function:

Field Documentation

◆ $current_node

Entry KSDocumentationTreeRecursion::$current_node
protected

Definition at line 32 of file KSDocumentationTreeRecursion.php.

◆ $entries

Entries KSDocumentationTreeRecursion::$entries
protected

Definition at line 30 of file KSDocumentationTreeRecursion.php.

Referenced by __construct(), and getChildren().

◆ $parent_uri

URI KSDocumentationTreeRecursion::$parent_uri
protected

Definition at line 31 of file KSDocumentationTreeRecursion.php.

Referenced by __construct().


The documentation for this class was generated from the following file: