ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilDclTableViewBaseDefaultValue.php
Go to the documentation of this file.
1 <?php
2 
20 {
24  public static function findSingle(
25  int $data_type_id,
26  int $tview_id
27  ): ?ActiveRecord { //?|ActiveRecord|ilDclTableViewBaseDefaultValue
28  $storage_location = ilDclCache::getDatatype($data_type_id)->getStorageLocation();
29  if (is_null($storage_location) || $storage_location == 0) {
30  return null;
31  }
32 
33  try {
35  $class = ilDclDefaultValueFactory::STORAGE_LOCATION_MAPPING[$storage_location];
36  return $class::getCollection()->where(array("tview_set_id" => $tview_id))->first();
37  } catch (Exception $ex) {
38  return null;
39  }
40  }
41 
42  public static function findAll(int $data_type_id, int $tview_id): ?array
43  {
44  $storage_location = ilDclCache::getDatatype($data_type_id)->getStorageLocation();
45  if (is_null($storage_location) || $storage_location == 0) {
46  return null;
47  }
48 
49  try {
50  $class = ilDclDefaultValueFactory::STORAGE_LOCATION_MAPPING[$storage_location];
51  return $class::getCollection()->where(array("tview_set_id" => $tview_id))->get();
52  } catch (Exception $ex) {
53  return null;
54  }
55  }
56 }
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)
static getDatatype(int $datatyp_id)
Get cached datatypes.