ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilDclBooleanFieldModel.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 {
27  public function getRecordQueryFilterObject(
28  $filter_value = "",
29  ?ilDclBaseFieldModel $sort_field = null
31  $where_additions = "";
32 
33  $join_str
34  = "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 = "
35  . $this->db->quote($this->getId(), 'integer') . ")";
36  if ($filter_value == "checked") {
37  $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";
38  $join_str .= " AND filter_stloc_{$this->getId()}.value = " . $this->db->quote(1, 'integer');
39  } else {
40  $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";
41  $where_additions = " AND (filter_stloc_{$this->getId()}.value <> " . $this->db->quote(1, 'integer')
42  . " OR filter_stloc_{$this->getId()}.value is NULL)";
43  }
44  $join_str .= " ) ";
45 
46  $sql_obj = new ilDclRecordQueryObject();
47  $sql_obj->setJoinStatement($join_str);
48  if ($where_additions) {
49  $sql_obj->setWhereStatement($where_additions);
50  }
51 
52  return $sql_obj;
53  }
54 }
getRecordQueryFilterObject( $filter_value="", ?ilDclBaseFieldModel $sort_field=null)
Returns a query-object for building the record-loader-sql-query.