ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilDclNumberFieldModel.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 $from = (isset($filter_value['from'])) ? (int) $filter_value['from'] : null;
25 $to = (isset($filter_value['to'])) ? (int) $filter_value['to'] : null;
26
27 $join_str
28 = "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 = "
29 . $ilDB->quote($this->getId(), 'integer') . ") ";
30 $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";
31 if (!is_null($from)) {
32 $join_str .= " AND filter_stloc_{$this->getId()}.value >= " . $ilDB->quote($from, 'integer');
33 }
34 if (!is_null($to)) {
35 $join_str .= " AND filter_stloc_{$this->getId()}.value <= " . $ilDB->quote($to, 'integer');
36 }
37 $join_str .= ") ";
38
39 $sql_obj = new ilDclRecordQueryObject();
40 $sql_obj->setJoinStatement($join_str);
41
42 return $sql_obj;
43 }
44
45
46 public function hasNumericSorting()
47 {
48 return true;
49 }
50
51
52 public function checkValidity($value, $record_id = null)
53 {
54 $valid = parent::checkValidity($value, $record_id);
55
56 if (!is_numeric($value) && $value != '') {
58 }
59
60 return $valid;
61 }
62}
An exception for terminatinating execution or to throw for unit testing.
Class ilDclBaseFieldModel.
Class ilDclBaseFieldModel.
Class ilDclBooleanFieldModel.
getRecordQueryFilterObject($filter_value="", ilDclBaseFieldModel $sort_field=null)
Returns a query-object for building the record-loader-sql-query.
checkValidity($value, $record_id=null)
Check if input is valid.
hasNumericSorting()
Set to true, when the sorting should be handled numerical.
Class ilDclRecordQueryObject.
$valid
global $DIC
Definition: goto.php:24
global $ilDB