ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilLMContentSearch Class Reference
+ Inheritance diagram for ilLMContentSearch:
+ Collaboration diagram for ilLMContentSearch:

Public Member Functions

 performSearch ()
 
 __createInStatement ()
 
- Public Member Functions inherited from ilAbstractSearch
 __construct (ilQueryParser $qp_obj)
 
 setFields (array $a_fields)
 
 getFields ()
 
 setFilter (array $a_filter)
 
 setIdFilter (array $a_id_filter)
 
 getIdFilter ()
 
 appendToFilter (string $a_type)
 
 getFilter ()
 
 __createLocateString ()
 
 __prepareFound (object $row)
 
 performSearch ()
 

Additional Inherited Members

- Protected Attributes inherited from ilAbstractSearch
ilDBInterface $db
 
ilQueryParser $query_parser
 
ilSearchResult $search_result
 
array $object_types
 

Detailed Description

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

Member Function Documentation

◆ __createInStatement()

ilLMContentSearch::__createInStatement ( )

Definition at line 71 of file class.ilLMContentSearch.php.

References $DIC, $ilDB, ilAbstractSearch\getFilter(), and ilAbstractSearch\getIdFilter().

Referenced by performSearch().

71  : string
72  {
73  global $DIC;
74 
75  $ilDB = $DIC['ilDB'];
76 
77  if (!$this->getFilter() and !$this->getIdFilter()) {
78  return '';
79  }
80 
81  $in = '';
82  if ($this->getFilter()) {
83  $type = "('";
84  $type .= implode("','", $this->getFilter());
85  $type .= "')";
86 
87  $in = " AND parent_type IN " . $type . ' ';
88  }
89  if ($this->getIdFilter()) {
90  $in .= ' AND ';
91  $in .= $ilDB->in('parent_id', $this->getIdFilter(), false, 'integer');
92  }
93  return $in;
94  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ performSearch()

ilLMContentSearch::performSearch ( )

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

References $res, ilAbstractSearch\$search_result, __createInStatement(), ilAbstractSearch\__createLocateString(), ilDBConstants\FETCHMODE_OBJECT, ILIAS\Repository\int(), and ilAbstractSearch\setFields().

40  {
41  $this->setFields(array('content'));
42 
43  $in = $this->__createInStatement();
44  $where = $this->__createWhereCondition();
45  $locate = $this->__createLocateString();
46 
47  $query = "SELECT page_id,parent_id,parent_type " .
48  $locate .
49  "FROM page_object, lm_data " .
50  $where .
51  "AND obj_id = page_id " .
52  $in;
53 
54 
55  $res = $this->db->query($query);
56  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
57  $this->search_result->addEntry(
58  (int) $row->parent_id,
59  (string) $row->parent_type,
60  $this->__prepareFound($row),
61  (int) $row->page_id
62  );
63  }
64 
65  return $this->search_result;
66  }
$res
Definition: ltiservices.php:69
setFields(array $a_fields)
ilSearchResult $search_result
+ Here is the call graph for this function:

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