ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
class.ilDclTableViewBaseDefaultValue.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 {
26  public static function findSingle(
27  int $data_type_id,
28  int $tview_id
29  ): ?ActiveRecord { //?|ActiveRecord|ilDclTableViewBaseDefaultValue
30  $storage_location = ilDclCache::getDatatype($data_type_id)->getStorageLocation();
31  if ($storage_location == 0) {
32  return null;
33  }
34 
35  try {
37  $class = ilDclDefaultValueFactory::STORAGE_LOCATION_MAPPING[$storage_location];
38  return $class::getCollection()->where(["tview_set_id" => $tview_id])->first();
39  } catch (Exception) {
40  return null;
41  }
42  }
43 
44  public static function findAll(int $data_type_id, int $tview_id): ?array
45  {
46  $storage_location = ilDclCache::getDatatype($data_type_id)->getStorageLocation();
47  if ($storage_location == 0) {
48  return null;
49  }
50 
51  try {
52  $class = ilDclDefaultValueFactory::STORAGE_LOCATION_MAPPING[$storage_location];
53 
54  return (new $class())::getCollection()->where(["tview_set_id" => $tview_id])->get();
55  } catch (Exception) {
56  return null;
57  }
58  }
59 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static findAll(int $data_type_id, int $tview_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static getDatatype(int $datatyp_id)
Get cached datatypes.