31 string $direction =
"asc",
32 bool $sort_by_status =
false 39 $this->
getProperty(self::PROP_REFERENCE) === null ||
47 $select_str =
"stloc_{$this->getId()}_joined.value AS field_{$this->getId()},";
48 $join_str =
"LEFT JOIN il_dcl_record_field AS record_field_{$this->getId()} ON (record_field_{$this->getId()}.record_id = record.id AND record_field_{$this->getId()}.field_id = " 49 .
$ilDB->quote($this->
getId(),
'integer') .
") ";
50 $join_str .=
"LEFT JOIN il_dcl_stloc{$this->getStorageLocation()}_value AS stloc_{$this->getId()} ON (stloc_{$this->getId()}.record_field_id = record_field_{$this->getId()}.id) ";
51 $join_str .=
"LEFT JOIN il_dcl_record_field AS record_field_{$this->getId()}_joined ON (record_field_{$this->getId()}_joined.record_id = stloc_{$this->getId()}.value AND record_field_{$this->getId()}_joined.field_id = " 52 .
$ilDB->quote($ref_field->getId(),
'integer') .
") ";
53 $join_str .=
"LEFT JOIN il_dcl_stloc{$ref_field->getStorageLocation()}_value AS stloc_{$this->getId()}_joined ON (stloc_{$this->getId()}_joined.record_field_id = record_field_{$this->getId()}_joined.id) ";
56 $sql_obj->setSelectStatement($select_str);
57 $sql_obj->setJoinStatement($join_str);
58 $sql_obj->setOrderStatement(
"field_{$this->getId()} " . $direction .
", ID ASC");
73 =
" LEFT 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 = " 74 .
$ilDB->quote($this->
getId(),
'integer') .
") ";
75 $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) ";
79 if ($filter_value ==
'none') {
81 .
"filter_stloc_{$this->getId()}.value IS NULL " 82 .
" OR filter_stloc_{$this->getId()}.value = " .
$ilDB->quote(
"",
'text')
83 .
" OR filter_stloc_{$this->getId()}.value = " .
$ilDB->quote(
"[]",
'text')
88 .=
" filter_stloc_{$this->getId()}.value LIKE " 89 .
$ilDB->quote(
"%$filter_value%",
'text');
92 .=
" filter_stloc_{$this->getId()}.value = " 93 .
$ilDB->quote($filter_value,
'integer');
98 $sql_obj->setJoinStatement($join_str);
99 $sql_obj->setWhereStatement($where_str);
126 public function afterClone(array $records):
void 134 if ($reference_clone) {
138 parent::afterClone($records);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
hasProperty(string $key)
Checks if a certain property for a field is set.
const PROP_REFERENCE_LINK
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getFieldCache(int $field_id=0)
getRecordQuerySortObject(string $direction="asc", bool $sort_by_status=false)
Returns a query-object for building the record-loader-sql-query.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
updateProperties()
Update properties of this field in Database.
getTableId()
Get table id.
getValidFieldProperties()
getRecordQueryFilterObject( $filter_value="", ?ilDclBaseFieldModel $sort_field=null)
afterClone(array $records)
getProperty(string $key)
Returns a certain property of a field.
static getCloneOf(int $id, string $type)
setProperty(string $key, $value)
Set a property for a field (does not save)