ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilLucenePathFilter Class Reference

Lucene path filter. More...

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

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

 $root = ROOT_FOLDER_ID
 
 $subnodes = array()
 

Detailed Description

Lucene path filter.

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

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

Constructor & Destructor Documentation

◆ __construct()

ilLucenePathFilter::__construct (   $a_root)

Constructor.

Parameters
int$a_rootroot id
Returns

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

46 {
47 $this->root = $a_root;
48 //$this->init();
49 }

Member Function Documentation

◆ filter()

ilLucenePathFilter::filter (   $a_ref_id)

Return whether a object reference is valid or not.

Parameters
int$a_ref_idreference id of object in question
Returns
boolean

Implements ilLuceneResultFilter.

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

57 {
58 global $tree;
59
60 if ($this->root == ROOT_FOLDER_ID) {
61 return true;
62 }
63 if ($this->root == $a_ref_id) {
64 return true;
65 }
66 return $tree->isGrandChild($this->root, $a_ref_id);
67 }

◆ init()

ilLucenePathFilter::init ( )
protected

Read valid reference ids.

Returns

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

74 {
75 global $tree;
76
77 if ($this->root == ROOT_FOLDER_ID) {
78 $this->subnodes = array();
79 } else {
80 $node = $tree->getNodeData($this->root);
81 $this->subnodes = $tree->getSubTree($node, false);
82 }
83 }

Field Documentation

◆ $root

ilLucenePathFilter::$root = ROOT_FOLDER_ID
protected

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

◆ $subnodes

ilLucenePathFilter::$subnodes = array()
protected

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


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