ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilTestSearch Class Reference
+ Inheritance diagram for ilTestSearch:
+ Collaboration diagram for ilTestSearch:

Public Member Functions

__searchTestIntroduction ()
 
__searchTestTitle ()
 
__searchSurveyIntroduction ()
 
__searchSurveyTitle ()
 
 performSearch ()
 
- Public Member Functions inherited from ilAbstractSearch
 __construct ($qp_obj)
 Constructor public. More...
 
 setFields ($a_fields)
 Set fields to search. More...
 
 getFields ()
 Get fields to search. More...
 
 setFilter ($a_filter)
 set object type to search in More...
 
 setIdFilter ($a_id_filter)
 Set id filter Filters search by given object id. More...
 
 getIdFilter ()
 Get Id filter. More...
 
 appendToFilter ($a_type)
 Append object type to filter. More...
 
 getFilter ()
 get object type to search in More...
 
 __createLocateString ()
 build locate string in case of AND search More...
 
 __prepareFound (&$row)
 
 performSearch ()
 

Additional Inherited Members

- Data Fields inherited from ilAbstractSearch
 $db = null
 
 $query_parser = null
 
 $search_result = null
 
 $object_types
 

Detailed Description

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

Member Function Documentation

◆ __searchSurveyIntroduction()

& ilTestSearch::__searchSurveyIntroduction ( )

Definition at line 75 of file class.ilTestSearch.php.

References $query, $res, $row, ilAbstractSearch\$search_result, ilAbstractSearch\__createLocateString(), ilDBConstants\FETCHMODE_OBJECT, ilAbstractSearch\getFields(), and ilAbstractSearch\setFields().

Referenced by performSearch().

76  {
77  $this->setFields(array('introduction'));
78 
79  $where = $this->__createWhereCondition(implode(',', $this->getFields()));
80  $locate = $this->__createLocateString();
81 
82  $query = "SELECT obj_fi " .
83  $locate .
84  "FROM svy_svy " .
85  $where;
86 
87  $res = $this->db->query($query);
88  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
89  $this->search_result->addEntry($row->obj_fi, 'svy', $this->__prepareFound($row));
90  }
91  return $this->search_result;
92  }
getFields()
Get fields to search.
__createLocateString()
build locate string in case of AND search
setFields($a_fields)
Set fields to search.
foreach($_POST as $key=> $value) $res
$query
$row
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __searchSurveyTitle()

& ilTestSearch::__searchSurveyTitle ( )

Definition at line 93 of file class.ilTestSearch.php.

References $query, $res, $row, ilAbstractSearch\$search_result, ilAbstractSearch\__createLocateString(), ilDBConstants\FETCHMODE_OBJECT, ilAbstractSearch\getFields(), and ilAbstractSearch\setFields().

Referenced by performSearch().

94  {
95  $this->setFields(array('title','description'));
96 
97  $where = $this->__createWhereCondition(implode(',', $this->getFields()));
98  $locate = $this->__createLocateString();
99 
100  $query = "SELECT obj_fi " .
101  $locate .
102  "FROM svy_question " .
103  $where;
104 
105  $res = $this->db->query($query);
106  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
107  $this->search_result->addEntry($row->obj_fi, 'spl', $this->__prepareFound($row));
108  }
109  return $this->search_result;
110  }
getFields()
Get fields to search.
__createLocateString()
build locate string in case of AND search
setFields($a_fields)
Set fields to search.
foreach($_POST as $key=> $value) $res
$query
$row
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __searchTestIntroduction()

& ilTestSearch::__searchTestIntroduction ( )

Definition at line 39 of file class.ilTestSearch.php.

References $query, $res, $row, ilAbstractSearch\$search_result, ilAbstractSearch\__createLocateString(), ilDBConstants\FETCHMODE_OBJECT, ilAbstractSearch\getFields(), and ilAbstractSearch\setFields().

Referenced by performSearch().

40  {
41  $this->setFields(array('introduction'));
42 
43  $where = $this->__createWhereCondition(implode(',', $this->getFields()));
44  $locate = $this->__createLocateString();
45 
46  $query = "SELECT obj_fi " .
47  $locate .
48  "FROM tst_tests " .
49  $where;
50 
51  $res = $this->db->query($query);
52  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
53  $this->search_result->addEntry($row->obj_fi, 'tst', $this->__prepareFound($row));
54  }
55  return $this->search_result;
56  }
getFields()
Get fields to search.
__createLocateString()
build locate string in case of AND search
setFields($a_fields)
Set fields to search.
foreach($_POST as $key=> $value) $res
$query
$row
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __searchTestTitle()

& ilTestSearch::__searchTestTitle ( )

Definition at line 57 of file class.ilTestSearch.php.

References $query, $res, $row, ilAbstractSearch\$search_result, ilAbstractSearch\__createLocateString(), ilDBConstants\FETCHMODE_OBJECT, ilAbstractSearch\getFields(), and ilAbstractSearch\setFields().

Referenced by performSearch().

58  {
59  $this->setFields(array('title','description'));
60 
61  $where = $this->__createWhereCondition(implode(',', $this->getFields()));
62  $locate = $this->__createLocateString();
63 
64  $query = "SELECT obj_fi " .
65  $locate .
66  "FROM qpl_questions " .
67  $where;
68 
69  $res = $this->db->query($query);
70  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
71  $this->search_result->addEntry($row->obj_fi, 'qpl', $this->__prepareFound($row));
72  }
73  return $this->search_result;
74  }
getFields()
Get fields to search.
__createLocateString()
build locate string in case of AND search
setFields($a_fields)
Set fields to search.
foreach($_POST as $key=> $value) $res
$query
$row
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ performSearch()

ilTestSearch::performSearch ( )

Definition at line 113 of file class.ilTestSearch.php.

References ilAbstractSearch\$search_result, __searchSurveyIntroduction(), __searchSurveyTitle(), __searchTestIntroduction(), and __searchTestTitle().

114  {
115  $this->__searchTestTitle();
116  $this->__searchTestIntroduction();
117  $this->__searchSurveyTitle();
119 
120  return $this->search_result;
121  }
+ Here is the call graph for this function:

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