ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 = "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 = "
28  . $ilDB->quote($this->getId(), 'integer') . ") ";
29  $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";
30  if (!is_null($from)) {
31  $join_str .= " AND filter_stloc_{$this->getId()}.value >= " . $ilDB->quote($from, 'integer');
32  }
33  if (!is_null($to)) {
34  $join_str .= " AND filter_stloc_{$this->getId()}.value <= " . $ilDB->quote($to, 'integer');
35  }
36  $join_str .= ") ";
37 
38  $sql_obj = new ilDclRecordQueryObject();
39  $sql_obj->setJoinStatement($join_str);
40 
41  return $sql_obj;
42  }
43 
44 
45  public function hasNumericSorting()
46  {
47  return true;
48  }
49 
50 
51  public function checkValidity($value, $record_id = null)
52  {
53  $valid = parent::checkValidity($value, $record_id);
54 
55  if (!is_numeric($value) && $value != '') {
57  }
58  return $valid;
59  }
60 }
Class ilDclBaseFieldModel.
Class ilDclRecordQueryObject.
global $DIC
Definition: saml.php:7
$valid
Class ilDclBaseFieldModel.
$from
Class ilDclBooleanFieldModel.
checkValidity($value, $record_id=null)
getRecordQueryFilterObject($filter_value="", ilDclBaseFieldModel $sort_field=null)
Returns a query-object for building the record-loader-sql-query.
global $ilDB