ILIAS  release_8 Revision v8.23
ilLucenePathFilter Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilLucenePathFilter:
+ Collaboration diagram for ilLucenePathFilter:

Public Member Functions

 __construct (int $a_root)
 
 filter (int $a_ref_id)
 Return whether a object reference is valid or not. More...
 

Protected Member Functions

 init ()
 Read valid reference ids. More...
 

Protected Attributes

int $root
 
array $subnodes = []
 
ilTree $tree
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Lucene path filter

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 27 of file class.ilLucenePathFilter.php.

Constructor & Destructor Documentation

◆ __construct()

ilLucenePathFilter::__construct ( int  $a_root)

Definition at line 33 of file class.ilLucenePathFilter.php.

References $DIC.

34  {
35  global $DIC;
36 
37  $this->tree = $DIC->repositoryTree();
38  $this->root = $a_root;
39  }
global $DIC
Definition: feed.php:28

Member Function Documentation

◆ filter()

ilLucenePathFilter::filter ( int  $a_ref_id)

Return whether a object reference is valid or not.

Implements ilLuceneResultFilter.

Definition at line 44 of file class.ilLucenePathFilter.php.

References ROOT_FOLDER_ID.

44  : bool
45  {
46  if ($this->root == ROOT_FOLDER_ID) {
47  return true;
48  }
49  if ($this->root == $a_ref_id) {
50  return true;
51  }
52  return $this->tree->isGrandChild($this->root, $a_ref_id);
53  }
const ROOT_FOLDER_ID
Definition: constants.php:32

◆ init()

ilLucenePathFilter::init ( )
protected

Read valid reference ids.

Returns
void

Definition at line 59 of file class.ilLucenePathFilter.php.

References ROOT_FOLDER_ID.

59  : void
60  {
61  if ($this->root == ROOT_FOLDER_ID) {
62  $this->subnodes = array();
63  } else {
64  $node = $this->tree->getNodeData($this->root);
65  $this->subnodes = $this->tree->getSubTree($node, false);
66  }
67  }
const ROOT_FOLDER_ID
Definition: constants.php:32

Field Documentation

◆ $root

int ilLucenePathFilter::$root
protected

Definition at line 29 of file class.ilLucenePathFilter.php.

◆ $subnodes

array ilLucenePathFilter::$subnodes = []
protected

Definition at line 30 of file class.ilLucenePathFilter.php.

◆ $tree

ilTree ilLucenePathFilter::$tree
protected

Definition at line 31 of file class.ilLucenePathFilter.php.


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