ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilDclBooleanFieldModel.php
Go to the documentation of this file.
1<?php
2
10{
11
18 public function getRecordQueryFilterObject($filter_value = "", ilDclBaseFieldModel $sort_field = null)
19 {
20 global $DIC;
21 $ilDB = $DIC['ilDB'];
22
23 if ($filter_value == "checked") {
24 $join_str = "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 = "
25 . $ilDB->quote($this->getId(), 'integer') . ")";
26 $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";
27 $join_str .= " AND filter_stloc_{$this->getId()}.value = " . $ilDB->quote(1, 'integer');
28 } else {
29 $join_str = "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 = "
30 . $ilDB->quote($this->getId(), 'integer') . ")";
31 $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";
32 $where_additions = " AND (filter_stloc_{$this->getId()}.value <> " . $ilDB->quote(1, 'integer')
33 . " OR filter_stloc_{$this->getId()}.value is NULL)";
34 }
35 $join_str .= " ) ";
36
37 $sql_obj = new ilDclRecordQueryObject();
38 $sql_obj->setJoinStatement($join_str);
39 $sql_obj->setWhereStatement($where_additions);
40
41 return $sql_obj;
42 }
43}
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