ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ilLucenePathFilter Class Reference

Lucene path filter. 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

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: shib_login.php:26

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: