ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilDclBooleanFieldModel.php
Go to the documentation of this file.
1<?php
2
10{
11
19 public function getRecordQueryFilterObject($filter_value = "", ilDclBaseFieldModel $sort_field = null)
20 {
21 global $DIC;
22 $ilDB = $DIC['ilDB'];
23
24 if ($filter_value == "checked") {
25 $join_str
26 = "INNER JOIN il_dcl_record_field AS filter_record_field_{$this->getId()} ON (filter_record_field_{$this->getId()}.record_id = record.id AND filter_record_field_{$this->getId()}.field_id = "
27 . $ilDB->quote($this->getId(), 'integer') . ")";
28 $join_str .= "INNER JOIN il_dcl_stloc{$this->getStorageLocation()}_value AS filter_stloc_{$this->getId()} ON (filter_stloc_{$this->getId()}.record_field_id = filter_record_field_{$this->getId()}.id";
29 $join_str .= " AND filter_stloc_{$this->getId()}.value = " . $ilDB->quote(1, 'integer');
30 } else {
31 $join_str
32 = "INNER JOIN il_dcl_record_field AS filter_record_field_{$this->getId()} ON (filter_record_field_{$this->getId()}.record_id = record.id AND filter_record_field_{$this->getId()}.field_id = "
33 . $ilDB->quote($this->getId(), 'integer') . ")";
34 $join_str .= "LEFT JOIN il_dcl_stloc{$this->getStorageLocation()}_value AS filter_stloc_{$this->getId()} ON (filter_stloc_{$this->getId()}.record_field_id = filter_record_field_{$this->getId()}.id";
35 $where_additions = " AND (filter_stloc_{$this->getId()}.value <> " . $ilDB->quote(1, 'integer')
36 . " OR filter_stloc_{$this->getId()}.value is NULL)";
37 }
38 $join_str .= " ) ";
39
40 $sql_obj = new ilDclRecordQueryObject();
41 $sql_obj->setJoinStatement($join_str);
42 $sql_obj->setWhereStatement($where_additions);
43
44 return $sql_obj;
45 }
46}
An exception for terminatinating execution or to throw for unit testing.
Class ilDclBaseFieldModel.
Class ilDclBooleanFieldModel.
getRecordQueryFilterObject($filter_value="", ilDclBaseFieldModel $sort_field=null)
Returns a query-object for building the record-loader-sql-query.
Class ilDclRecordQueryObject.
global $DIC
Definition: saml.php:7
global $ilDB