ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilObjectSearch Class Reference
+ Inheritance diagram for ilObjectSearch:
+ Collaboration diagram for ilObjectSearch:

Public Member Functions

 __construct (ilQueryParser $qp_obj)
 
 performSearch ()
 
 __createInStatement ()
 
 setCreationDateFilterStartDate (?ilDate $day)
 
 getCreationDateFilterStartDate ()
 
 setCreationDateFilterEndDate (?ilDate $day)
 
 getCreationDateFilterEndDate ()
 
- 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 ()
 

Static Public Member Functions

static raiseContentChanged (int $obj_id)
 

Private Attributes

ilDate $cdate_start_date = null
 
ilDate $cdate_end_date = null
 

Additional Inherited Members

- Protected Member Functions inherited from ilAbstractSearch
 getValidObjectTypes (ilObjectDefinition $object_definition)
 
- Protected Attributes inherited from ilAbstractSearch
ilDBInterface $db
 
ilQueryParser $query_parser
 
ilSearchResult $search_result
 
array $object_types = []
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilObjectSearch::__construct ( ilQueryParser  $qp_obj)

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

References ILIAS\GlobalScreen\Provider\__construct(), and ilAbstractSearch\setFields().

37  {
38  parent::__construct($qp_obj);
39  $this->setFields(array('title','description'));
40  }
setFields(array $a_fields)
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ __createInStatement()

ilObjectSearch::__createInStatement ( )

Definition at line 92 of file class.ilObjectSearch.php.

References ilAbstractSearch\getIdFilter().

Referenced by performSearch().

92  : string
93  {
94  $in = ' AND ' . $this->db->in('type', (array) $this->object_types, false, 'text');
95  if ($this->getIdFilter()) {
96  $in .= ' AND ';
97  $in .= $this->db->in('obj_id', $this->getIdFilter(), false, 'integer');
98  }
99  return $in;
100  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCreationDateFilterEndDate()

ilObjectSearch::getCreationDateFilterEndDate ( )

Definition at line 118 of file class.ilObjectSearch.php.

References $cdate_end_date.

Referenced by performSearch().

118  : ?ilDate
119  {
120  return $this->cdate_end_date;
121  }
+ Here is the caller graph for this function:

◆ getCreationDateFilterStartDate()

ilObjectSearch::getCreationDateFilterStartDate ( )

Definition at line 108 of file class.ilObjectSearch.php.

References $cdate_start_date.

Referenced by performSearch().

108  : ?ilDate
109  {
111  }
+ Here is the caller graph for this function:

◆ performSearch()

ilObjectSearch::performSearch ( )

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

References $res, ilAbstractSearch\$search_result, __createInStatement(), ilAbstractSearch\__createLocateString(), ilDBConstants\FETCHMODE_OBJECT, getCreationDateFilterEndDate(), getCreationDateFilterStartDate(), ilLoggerFactory\getLogger(), and IL_CAL_DATE.

57  {
58  $in = $this->__createInStatement();
59  $where = $this->__createWhereCondition();
60 
61 
62 
63  $cdate = '';
64  if ($this->getCreationDateFilterStartDate() && is_null($this->getCreationDateFilterEndDate())) {
65  $cdate = 'AND create_date >= ' . $this->db->quote($this->getCreationDateFilterStartDate()->get(IL_CAL_DATE), 'text') . ' ';
66  } elseif ($this->getCreationDateFilterEndDate() && is_null($this->getCreationDateFilterStartDate())) {
67  $cdate = 'AND create_date <= ' . $this->db->quote($this->getCreationDateFilterEndDate()->get(IL_CAL_DATE), 'text') . ' ';
68  } elseif ($this->getCreationDateFilterStartDate() && $this->getCreationDateFilterEndDate()) {
69  $cdate = 'AND create_date >= ' . $this->db->quote($this->getCreationDateFilterStartDate()->get(IL_CAL_DATE), 'text') . ' ' .
70  'AND create_date <= ' . $this->db->quote($this->getCreationDateFilterEndDate()->get(IL_CAL_DATE), 'text') . ' ';
71  }
72 
73  $locate = $this->__createLocateString();
74 
75  $query = "SELECT obj_id,type " .
76  $locate .
77  "FROM object_data " .
78  $where . " " . $cdate . ' ' . $in . ' ' .
79  "ORDER BY obj_id DESC";
80 
81  ilLoggerFactory::getLogger('src')->debug('Object search query: ' . $query);
82 
83  $res = $this->db->query($query);
84  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
85  $this->search_result->addEntry((int) $row->obj_id, (string) $row->type, $this->__prepareFound($row));
86  }
87  return $this->search_result;
88  }
$res
Definition: ltiservices.php:66
static getLogger(string $a_component_id)
Get component logger.
const IL_CAL_DATE
ilSearchResult $search_result
+ Here is the call graph for this function:

◆ raiseContentChanged()

static ilObjectSearch::raiseContentChanged ( int  $obj_id)
static

Definition at line 43 of file class.ilObjectSearch.php.

References $DIC.

Referenced by ilExAssignment\save(), ilWikiPage\update(), and ilExAssignment\update().

43  : void
44  {
45  global $DIC;
46 
47  $DIC->event()->raise(
48  'components/ILIAS/Search',
49  'contentChanged',
50  [
51  "obj_id" => $obj_id
52  ]
53  );
54  }
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ setCreationDateFilterEndDate()

ilObjectSearch::setCreationDateFilterEndDate ( ?ilDate  $day)

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

Referenced by ilSearchGUI\parseCreationFilter().

113  : void
114  {
115  $this->cdate_end_date = $day;
116  }
+ Here is the caller graph for this function:

◆ setCreationDateFilterStartDate()

ilObjectSearch::setCreationDateFilterStartDate ( ?ilDate  $day)

Definition at line 103 of file class.ilObjectSearch.php.

Referenced by ilSearchGUI\parseCreationFilter().

103  : void
104  {
105  $this->cdate_start_date = $day;
106  }
+ Here is the caller graph for this function:

Field Documentation

◆ $cdate_end_date

ilDate ilObjectSearch::$cdate_end_date = null
private

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

Referenced by getCreationDateFilterEndDate().

◆ $cdate_start_date

ilDate ilObjectSearch::$cdate_start_date = null
private

Definition at line 32 of file class.ilObjectSearch.php.

Referenced by getCreationDateFilterStartDate().


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