ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
class.ilDclCopyFieldModel.php
Go to the documentation of this file.
1 <?php
2 
20 {
21  public function getRecordQueryFilterObject(
22  $filter_value = "",
23  ?ilDclBaseFieldModel $sort_field = null
25  $join_str
26  = "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 = "
27  . $this->db->quote($this->getId(), 'integer') . ") ";
28  $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 AND filter_stloc_{$this->getId()}.value LIKE "
29  . $this->db->quote("%$filter_value%", 'text') . ") ";
30 
31  $sql_obj = new ilDclRecordQueryObject();
32  $sql_obj->setJoinStatement($join_str);
33 
34  return $sql_obj;
35  }
36 
37  public function getValidFieldProperties(): array
38  {
39  return [
42  ];
43  }
44 
45  public function afterClone(array $records): void
46  {
48  $clone = ilDclCache::getCloneOf((int) $this->getId(), ilDclCache::TYPE_FIELD);
49  $copy_clone = ilDclCache::getCloneOf(
50  (int) $clone->getProperty(ilDclBaseFieldModel::PROP_REFERENCE),
52  );
53  if ($copy_clone) {
54  $this->setProperty(ilDclBaseFieldModel::PROP_REFERENCE, $copy_clone->getId());
55  $this->updateProperties();
56  }
57  parent::afterClone($records);
58  }
59 
60  public function getPresentationTitle(): string
61  {
62  return $this->lng->txt('dcl_copy_field');
63  }
64 
65  public function getPresentationDescription(): string
66  {
67  return $this->lng->txt('dcl_copy_field_desc');
68  }
69 }
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.
getRecordQueryFilterObject( $filter_value="", ?ilDclBaseFieldModel $sort_field=null)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static getCloneOf(int $id, string $type)
setProperty(string $key, $value)