ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
ilDataCollectionTable Class Reference

Class ilDataCollectionField. More...

+ Collaboration diagram for ilDataCollectionTable:

Public Member Functions

 __construct ($a_id=0)
 
 doRead ()
 Read table. More...
 
 doCreate ($create_views=true)
 
 doUpdate ()
 
 setId ($a_id)
 Set table id. More...
 
 getId ()
 Get table id. More...
 
 setObjId ($a_id)
 
 getObjId ()
 
 setTitle ($a_title)
 
 getTitle ()
 
 getCollectionObject ()
 
 getRecords ()
 
 getRecordsByFilter (array $filter=array())
 getRecordsByFilter More...
 
 getAll ($a_id)
 
 deleteField ($field_id)
 
 getField ($field_id)
 
 getFieldIds ()
 
 getNewOrder ()
 getNewOrder More...
 
 getFields ()
 Returns all fields of this table including the standard fields. More...
 
 getRecordFields ()
 Returns all fields of this table which are NOT standard fields. More...
 
 getVisibleFields ()
 Returns all fields of this table who have set their visibility to true, including standard fields. More...
 
 getEditableFields ()
 
 getFilterableFields ()
 getFilterableFields Returns all fields of this table who have set their filterable to true, including standard fields. More...
 
 getExportableFields ()
 Return all the fields that are marked as exportable. More...
 
 hasPermissionToFields ($ref_id)
 
 hasPermissionToAddTable ($ref_id)
 
 hasPermissionToAddRecord ($ref_id)
 
 hasPermissionToEditRecord ($ref_id, ilDataCollectionRecord $record)
 
 hasPermissionToDeleteRecord ($ref_id, ilDataCollectionRecord $record)
 
 hasPermissionToDeleteRecords ($ref_id)
 
 updateFields ()
 Update fields. More...
 
 sortFields (&$fields)
 sortFields More...
 
 buildOrderFields ()
 buildOrderFields orders the fields. More...
 
 getFieldByTitle ($title)
 Get a field by title. More...
 
 setAddPerm ($add_perm)
 
 getAddPerm ()
 
 setDeletePerm ($delete_perm)
 
 getDeletePerm ()
 
 setEditByOwner ($edit_by_owner)
 
 getEditByOwner ()
 
 setEditPerm ($edit_perm)
 
 getEditPerm ()
 
 setLimited ($limited)
 
 getLimited ()
 
 setLimitEnd ($limit_end)
 
 getLimitEnd ()
 
 setLimitStart ($limit_start)
 
 getLimitStart ()
 
 setIsVisible ($is_visible)
 
 getIsVisible ()
 
 setDescription ($description)
 
 getDescription ()
 
 setDefaultSortField ($default_sort_field)
 /** More...
 
 getDefaultSortField ()
 
 setDefaultSortFieldOrder ($default_sort_field_order)
 
 getDefaultSortFieldOrder ()
 
 setPublicCommentsEnabled ($public_comments)
 
 getPublicCommentsEnabled ()
 
 setViewOwnRecordsPerm ($view_own_perm)
 
 getViewOwnRecordsPerm ()
 
 hasCustomFields ()
 hasCustomFields More...
 
 compareOrder ($a, $b)
 
 cloneStructure (ilDataCollectionTable $original)
 
 _hasRecords ()
 _hasRecords More...
 
 addField ($field)
 
 setExportEnabled ($export_enabled)
 
 getExportEnabled ()
 
 getPartialRecords ($sort, $direction, $limit, $offset, array $filter=array())
 Return only the needed subset of record objects for the table, according to sorting, paging and filters. More...
 

Static Public Member Functions

static _tableExists ($table_id)
 
static _getTableIdByTitle ($title, $obj_id)
 
static _hasFieldByTitle ($title, $obj_id)
 Checks if a table has a field with the given title. More...
 

Protected Member Functions

 loadObj ()
 
 loadRecords ()
 
 loadFields ()
 
 checkEditByOwner (ilDataCollectionRecord $record)
 
 checkLimit ()
 
 sortByOrder (&$array)
 

Protected Attributes

 $id = 0
 
 $objId
 
 $obj
 
 $title
 
 $fields
 
 $stdFields
 
 $records
 
 $is_visible
 
 $add_perm
 
 $edit_perm
 
 $delete_perm
 
 $edit_by_owner
 
 $limited
 
 $limit_start
 
 $limit_end
 
 $export_enabled
 
 $default_sort_field = 0
 
 $default_sort_field_order = 'asc'
 
 $description = ''
 
 $public_comments = 0
 
 $view_own_records_perm = 0
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilDataCollectionTable::__construct (   $a_id = 0)
Parameters
int$a_id

Definition at line 121 of file class.ilDataCollectionTable.php.

References doRead().

121  {
122  if ($a_id != 0) {
123  $this->id = $a_id;
124  $this->doRead();
125  }
126  }
+ Here is the call graph for this function:

Member Function Documentation

◆ _getTableIdByTitle()

static ilDataCollectionTable::_getTableIdByTitle (   $title,
  $obj_id 
)
static
Parameters
$titleTitle of table
$obj_idDataCollection object ID where the table belongs to
Returns
int

Definition at line 1255 of file class.ilDataCollectionTable.php.

References $id, $ilDB, $result, and $title.

Referenced by ilObjDataCollection\cloneStructure().

1255  {
1256  global $ilDB;
1257  $result = $ilDB->query('SELECT id FROM il_dcl_table WHERE title = ' . $ilDB->quote($title, 'text') . ' AND obj_id = '
1258  . $ilDB->quote($obj_id, 'integer'));
1259  $id = 0;
1260  while ($rec = $ilDB->fetchAssoc($result)) {
1261  $id = $rec['id'];
1262  }
1263 
1264  return $id;
1265  }
$result
global $ilDB
+ Here is the caller graph for this function:

◆ _hasFieldByTitle()

static ilDataCollectionTable::_hasFieldByTitle (   $title,
  $obj_id 
)
static

Checks if a table has a field with the given title.

Parameters
$titleTitle of field
$obj_idObj-ID of the table
Returns
bool

Definition at line 1292 of file class.ilDataCollectionTable.php.

References $ilDB, $result, and $title.

Referenced by ilDataCollectionFieldEditGUI\checkInput().

1292  {
1293  global $ilDB;
1294  $result = $ilDB->query('SELECT * FROM il_dcl_field WHERE table_id = ' . $ilDB->quote($obj_id, 'integer') . ' AND title = '
1295  . $ilDB->quote($title, 'text'));
1296 
1297  return ($ilDB->numRows($result)) ? true : false;
1298  }
$result
global $ilDB
+ Here is the caller graph for this function:

◆ _hasRecords()

ilDataCollectionTable::_hasRecords ( )

_hasRecords

Returns
boolean

Definition at line 1222 of file class.ilDataCollectionTable.php.

References getRecords().

1222  {
1223  return (count($this->getRecords()) > 0) ? true : false;
1224  }
+ Here is the call graph for this function:

◆ _tableExists()

static ilDataCollectionTable::_tableExists (   $table_id)
static
Parameters
$table_idint
Returns
bool returns true iff there exists a table with id $table_id

Definition at line 1240 of file class.ilDataCollectionTable.php.

References $ilDB, $query, and $result.

Referenced by ilDataCollectionRecord\doCreate(), and ilDataCollectionField\doCreate().

1240  {
1241  global $ilDB;
1242  $query = "SELECT * FROM il_dcl_table WHERE id = " . $table_id;
1243  $result = $ilDB->query($query);
1244 
1245  return $result->numRows() != 0;
1246  }
$result
global $ilDB
+ Here is the caller graph for this function:

◆ addField()

ilDataCollectionTable::addField (   $field)
Parameters
$fieldilDataCollectionField add an already created field for eg. ordering.

Definition at line 1230 of file class.ilDataCollectionTable.php.

References fields.

1230  {
1231  $this->fields[$field->getId()] = $field;
1232  }
$errors fields
Definition: imgupload.php:48

◆ buildOrderFields()

ilDataCollectionTable::buildOrderFields ( )

buildOrderFields orders the fields.

Definition at line 871 of file class.ilDataCollectionTable.php.

References $fields, getFields(), and sortByOrder().

Referenced by doCreate().

871  {
872  $fields = $this->getFields();
873  $this->sortByOrder($fields);
874  $count = 10;
875  $offset = 10;
876  foreach ($fields as $field) {
877  if (! is_null($field->getOrder())) {
878  $field->setOrder($count);
879  $count = $count + $offset;
880  $field->doUpdate();
881  }
882  }
883  }
getFields()
Returns all fields of this table including the standard fields.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkEditByOwner()

ilDataCollectionTable::checkEditByOwner ( ilDataCollectionRecord  $record)
protected
Parameters
ilDataCollectionRecord$record
Returns
bool

Definition at line 809 of file class.ilDataCollectionTable.php.

References $ilUser, and ilDataCollectionRecord\getOwner().

Referenced by hasPermissionToDeleteRecord(), and hasPermissionToEditRecord().

809  {
810  global $ilUser;
811 
812  return ($ilUser->getId() == $record->getOwner());
813  }
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkLimit()

ilDataCollectionTable::checkLimit ( )
protected
Returns
bool

Definition at line 819 of file class.ilDataCollectionTable.php.

References getLimited(), getLimitEnd(), getLimitStart(), and IL_CAL_DATE.

Referenced by hasPermissionToAddRecord(), hasPermissionToDeleteRecord(), and hasPermissionToEditRecord().

819  {
820  if ($this->getLimited()) {
821  $now = new ilDateTime(date("Y-m-d H:i:s"), IL_CAL_DATE);
822  $from = new ilDateTime($this->getLimitStart(), IL_CAL_DATE);
823  $to = new ilDateTime($this->getLimitEnd(), IL_CAL_DATE);
824  return ($from <= $now && $now <= $to);
825  }
826 
827  return true;
828  }
Date and time handling
const IL_CAL_DATE
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cloneStructure()

ilDataCollectionTable::cloneStructure ( ilDataCollectionTable  $original)
Parameters
ilDataCollectionTable$original

Definition at line 1151 of file class.ilDataCollectionTable.php.

References $default_sort_field, cloneStructure(), doCreate(), doUpdate(), getAddPerm(), getDefaultSortField(), getDefaultSortFieldOrder(), getDeletePerm(), getDescription(), getEditByOwner(), getEditPerm(), getExportEnabled(), getFields(), getId(), ilDataCollectionRecordViewViewdefinition\getIdByTableId(), getIsVisible(), getLimited(), getLimitEnd(), getLimitStart(), getPublicCommentsEnabled(), getTitle(), getViewOwnRecordsPerm(), setAddPerm(), setDefaultSortField(), setDefaultSortFieldOrder(), setDeletePerm(), setDescription(), setEditByOwner(), setEditPerm(), setExportEnabled(), setIsVisible(), setLimited(), setLimitEnd(), setLimitStart(), setPublicCommentsEnabled(), setTitle(), and setViewOwnRecordsPerm().

Referenced by cloneStructure().

1151  {
1152  $this->setTitle($original->getTitle());
1153  $this->setDescription($original->getDescription());
1154  $this->setIsVisible($original->getIsVisible());
1155  $this->setEditByOwner($original->getEditByOwner());
1156  $this->setAddPerm($original->getAddPerm());
1157  $this->setEditPerm($original->getEditPerm());
1158  $this->setDeletePerm($original->getDeletePerm());
1159  $this->setLimited($original->getLimited());
1160  $this->setLimitStart($original->getLimitStart());
1161  $this->setLimitEnd($original->getLimitEnd());
1162  $this->setViewOwnRecordsPerm($original->getViewOwnRecordsPerm());
1163  $this->setExportEnabled($original->getExportEnabled());
1166 
1167  $this->doCreate();
1168  // reset stdFields to get new for the created object
1169 
1170  $default_sort_field = 0;
1171  // Clone standard-fields
1172  $org_std_fields = $original->getStandardFields();
1173  foreach ($this->getStandardFields() as $element_key => $std_field) {
1174  $std_field->cloneStructure($org_std_fields[$element_key]);
1175  if ($std_field->getId() == $original->getDefaultSortField()) {
1176  $default_sort_field = $std_field->getId();
1177  }
1178  }
1179 
1180  // Clone fields
1181  $new_fields = array();
1182  foreach ($original->getFields() as $orig_field) {
1183  if (! $orig_field->isStandardField()) {
1184  $new_field = new ilDataCollectionField();
1185  $new_field->setTableId($this->getId());
1186  $new_field->cloneStructure($orig_field->getId());
1187  $new_fields[$orig_field->getId()] = $new_field;
1188 
1189  if ($orig_field->getId() == $original->getDefaultSortField()) {
1190  $default_sort_field = $new_field->getId();
1191  }
1192  }
1193  }
1194 
1196  $this->doUpdate();
1197 
1198  //TODO: Find better way to copy data (include referenced data)
1199  // Clone Records with recordfields
1200  /*foreach($original->getRecords() as $orig_record){
1201  $new_record = new ilDataCollectionRecord();
1202  $new_record->setTableId($this->getId());
1203  $new_record->cloneStructure($orig_record->getId(), $new_fields);
1204  }*/
1205 
1206  if ($old_view_id = ilDataCollectionRecordViewViewdefinition::getIdByTableId($original->getId())) {
1207  $old_view = new ilDataCollectionRecordViewViewdefinition($old_view_id);
1208  $old_view->setTableId($original->getId());
1210  $viewdef->setTableId($this->id);
1211  $viewdef->setXMLContent($old_view->getXMLContent(false));
1212  $viewdef->create();
1213  }
1214  }
static getIdByTableId($a_table_id)
Get view definition id by table id.
cloneStructure(ilDataCollectionTable $original)
setDefaultSortField($default_sort_field)
/**
getFields()
Returns all fields of this table including the standard fields.
Class ilDataCollectionField.
setDefaultSortFieldOrder($default_sort_field_order)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compareOrder()

ilDataCollectionTable::compareOrder (   $a,
  $b 
)

Definition at line 1133 of file class.ilDataCollectionTable.php.

1133  {
1134  if (is_null($a->getOrder() == NULL) && is_null($b->getOrder() == NULL)) {
1135  return 0;
1136  }
1137  if (is_null($a->getOrder())) {
1138  return 1;
1139  }
1140  if (is_null($b->getOrder())) {
1141  return - 1;
1142  }
1143 
1144  return $a->getOrder() < $b->getOrder() ? - 1 : 1;
1145  }

◆ deleteField()

ilDataCollectionTable::deleteField (   $field_id)
Parameters
$field_id

Definition at line 439 of file class.ilDataCollectionTable.php.

References $records, ilDataCollectionCache\getFieldCache(), and getRecords().

439  {
440  $field = ilDataCollectionCache::getFieldCache($field_id);
441  $records = $this->getRecords();
442 
443  foreach ($records as $record) {
444  $record->deleteField($field_id);
445  }
446 
447  $field->doDelete();
448  }
+ Here is the call graph for this function:

◆ doCreate()

ilDataCollectionTable::doCreate (   $create_views = true)
Parameters
bool$create_views

Definition at line 208 of file class.ilDataCollectionTable.php.

References $id, $ilDB, $query, buildOrderFields(), ilDataCollectionField\EDIT_VIEW, ilDataCollectionField\EXPORTABLE_VIEW, ilDataCollectionField\FILTER_VIEW, getAddPerm(), getDefaultSortField(), getDefaultSortFieldOrder(), getDeletePerm(), getDescription(), getEditByOwner(), getEditPerm(), getExportEnabled(), getId(), getIsVisible(), getLimited(), getLimitEnd(), getLimitStart(), getObjId(), getPublicCommentsEnabled(), getTitle(), getViewOwnRecordsPerm(), setId(), and ilDataCollectionField\VIEW_VIEW.

Referenced by cloneStructure().

208  {
209  global $ilDB;
210 
211  $id = $ilDB->nextId("il_dcl_table");
212  $this->setId($id);
213  $query = "INSERT INTO il_dcl_table (" . "id" . ", obj_id" . ", title" . ", add_perm" . ", edit_perm" . ", delete_perm" . ", edit_by_owner"
214  . ", limited" . ", limit_start" . ", limit_end" . ", is_visible" . ", export_enabled" . ", default_sort_field_id"
215  . ", default_sort_field_order" . ", description" . ", public_comments" . ", view_own_records_perm" . " ) VALUES ("
216  . $ilDB->quote($this->getId(), "integer") . "," . $ilDB->quote($this->getObjId(), "integer") . ","
217  . $ilDB->quote($this->getTitle(), "text") . "," . $ilDB->quote($this->getAddPerm() ? 1 : 0, "integer") . ","
218  . $ilDB->quote($this->getEditPerm() ? 1 : 0, "integer") . "," . $ilDB->quote($this->getDeletePerm() ? 1 : 0, "integer") . ","
219  . $ilDB->quote($this->getEditByOwner() ? 1 : 0, "integer") . "," . $ilDB->quote($this->getLimited() ? 1 : 0, "integer") . ","
220  . $ilDB->quote($this->getLimitStart(), "timestamp") . "," . $ilDB->quote($this->getLimitEnd(), "timestamp") . ","
221  . $ilDB->quote($this->getIsVisible() ? 1 : 0, "integer") . "," . $ilDB->quote($this->getExportEnabled() ? 1 : 0, "integer") . ","
222  . $ilDB->quote($this->getDefaultSortField(), "text") . "," . $ilDB->quote($this->getDefaultSortFieldOrder(), "text") . ","
223  . $ilDB->quote($this->getDescription(), "text") . "," . $ilDB->quote($this->getPublicCommentsEnabled(), "integer") . ","
224  . $ilDB->quote($this->getViewOwnRecordsPerm(), "integer") . ")";
225 
226  $ilDB->manipulate($query);
227 
228  if ($create_views) {
229  //add view definition
230  $view_id = $ilDB->nextId("il_dcl_view");
231  $query = "INSERT INTO il_dcl_view (id, table_id, type, formtype) VALUES (" . $ilDB->quote($view_id, "integer") . ", "
232  . $ilDB->quote($this->id, "integer") . ", " . $ilDB->quote(ilDataCollectionField::VIEW_VIEW, "integer") . ", "
233  . $ilDB->quote(1, "integer") . ")";
234  $ilDB->manipulate($query);
235 
236  //add edit definition
237  $view_id = $ilDB->nextId("il_dcl_view");
238  $query = "INSERT INTO il_dcl_view (id, table_id, type, formtype) VALUES (" . $ilDB->quote($view_id, "integer") . ", "
239  . $ilDB->quote($this->id, "integer") . ", " . $ilDB->quote(ilDataCollectionField::EDIT_VIEW, "integer") . ", "
240  . $ilDB->quote(1, "integer") . ")";
241  $ilDB->manipulate($query);
242 
243  //add filter definition
244  $view_id = $ilDB->nextId("il_dcl_view");
245  $query = "INSERT INTO il_dcl_view (id, table_id, type, formtype) VALUES (" . $ilDB->quote($view_id, "integer") . ", "
246  . $ilDB->quote($this->id, "integer") . ", " . $ilDB->quote(ilDataCollectionField::FILTER_VIEW, "integer") . ", "
247  . $ilDB->quote(1, "integer") . ")";
248  $ilDB->manipulate($query);
249 
250  //add filter definition
251  $view_id = $ilDB->nextId("il_dcl_view");
252  $query = "INSERT INTO il_dcl_view (id, table_id, type, formtype) VALUES (" . $ilDB->quote($view_id, "integer") . ", "
253  . $ilDB->quote($this->id, "integer") . ", " . $ilDB->quote(ilDataCollectionField::EXPORTABLE_VIEW, "integer") . ", "
254  . $ilDB->quote(1, "integer") . ")";
255  $ilDB->manipulate($query);
256 
257  $this->buildOrderFields();
258  }
259  }
buildOrderFields()
buildOrderFields orders the fields.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doRead()

ilDataCollectionTable::doRead ( )

Read table.

Definition at line 132 of file class.ilDataCollectionTable.php.

References $ilDB, $query, $row, getCollectionObject(), getId(), getRecordFields(), getRecords(), setAddPerm(), setDefaultSortField(), setDefaultSortFieldOrder(), setDeletePerm(), setDescription(), setEditByOwner(), setEditPerm(), setExportEnabled(), setIsVisible(), setLimited(), setLimitEnd(), setLimitStart(), setObjId(), setPublicCommentsEnabled(), setTitle(), and setViewOwnRecordsPerm().

Referenced by __construct().

132  {
133  global $ilDB;
134 
135  $query = "SELECT * FROM il_dcl_table WHERE id = " . $ilDB->quote($this->getId(), "integer");
136  $set = $ilDB->query($query);
137  $rec = $ilDB->fetchAssoc($set);
138 
139  $this->setObjId($rec["obj_id"]);
140  $this->setTitle($rec["title"]);
141  $this->setAddPerm($rec["add_perm"]);
142  $this->setEditPerm($rec["edit_perm"]);
143  $this->setDeletePerm($rec["delete_perm"]);
144  $this->setEditByOwner($rec["edit_by_owner"]);
145  $this->setExportEnabled($rec["export_enabled"]);
146  $this->setLimited($rec["limited"]);
147  $this->setLimitStart($rec["limit_start"]);
148  $this->setLimitEnd($rec["limit_end"]);
149  $this->setIsVisible($rec["is_visible"]);
150  $this->setDescription($rec['description']);
151  $this->setDefaultSortField($rec['default_sort_field_id']);
152  $this->setDefaultSortFieldOrder($rec['default_sort_field_order']);
153  $this->setPublicCommentsEnabled($rec['public_comments']);
154  $this->setViewOwnRecordsPerm($rec['view_own_records_perm']);
155  }
setDefaultSortField($default_sort_field)
/**
setDefaultSortFieldOrder($default_sort_field_order)
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doUpdate()

ilDataCollectionTable::doUpdate ( )

Definition at line 265 of file class.ilDataCollectionTable.php.

References $ilDB, getAddPerm(), getDefaultSortField(), getDefaultSortFieldOrder(), getDeletePerm(), getDescription(), getEditByOwner(), getEditPerm(), getExportEnabled(), getId(), getIsVisible(), getLimited(), getLimitEnd(), getLimitStart(), getObjId(), getPublicCommentsEnabled(), getTitle(), and getViewOwnRecordsPerm().

Referenced by cloneStructure().

265  {
266  global $ilDB;
267 
268  $ilDB->update("il_dcl_table", array(
269  "obj_id" => array( "integer", $this->getObjId() ),
270  "title" => array( "text", $this->getTitle() ),
271  "add_perm" => array( "integer", $this->getAddPerm() ),
272  "edit_perm" => array( "integer", $this->getEditPerm() ),
273  "delete_perm" => array( "integer", $this->getDeletePerm() ),
274  "edit_by_owner" => array( "integer", $this->getEditByOwner() ),
275  "limited" => array( "integer", $this->getLimited() ),
276  "limit_start" => array( "timestamp", $this->getLimitStart() ),
277  "limit_end" => array( "timestamp", $this->getLimitEnd() ),
278  "is_visible" => array( "integer", $this->getIsVisible() ? 1 : 0 ),
279  "export_enabled" => array( "integer", $this->getExportEnabled() ? 1 : 0 ),
280  "description" => array( "text", $this->getDescription() ),
281  "default_sort_field_id" => array( "text", $this->getDefaultSortField() ),
282  "default_sort_field_order" => array( "text", $this->getDefaultSortFieldOrder() ),
283  "public_comments" => array( "integer", $this->getPublicCommentsEnabled() ? 1 : 0 ),
284  "view_own_records_perm" => array( "integer", $this->getViewOwnRecordsPerm() ),
285  ), array(
286  "id" => array( "integer", $this->getId() )
287  ));
288  }
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAddPerm()

ilDataCollectionTable::getAddPerm ( )
Returns
boolean

Definition at line 917 of file class.ilDataCollectionTable.php.

References $add_perm.

Referenced by cloneStructure(), doCreate(), doUpdate(), and hasPermissionToAddRecord().

917  {
918  return (bool) $this->add_perm;
919  }
+ Here is the caller graph for this function:

◆ getAll()

ilDataCollectionTable::getAll (   $a_id)
Parameters
$a_id
Returns
array

Definition at line 420 of file class.ilDataCollectionTable.php.

References $ilDB, and $query.

Referenced by ilDataCollectionRecordListViewdefinitionGUI\initForm().

420  {
421  global $ilDB;
422 
423  // build query
424  $query = "SELECT * FROM il_dcl_table WHERE obj_id = " . $ilDB->quote($a_id, "integer");
425  $set = $ilDB->query($query);
426 
427  $all = array();
428  while ($rec = $ilDB->fetchAssoc($set)) {
429  $all[$rec['id']] = $rec;
430  }
431 
432  return $all;
433  }
global $ilDB
+ Here is the caller graph for this function:

◆ getCollectionObject()

ilDataCollectionTable::getCollectionObject ( )
Returns
ilObjDataCollection

Definition at line 346 of file class.ilDataCollectionTable.php.

References $obj, and loadObj().

Referenced by doRead().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefaultSortField()

ilDataCollectionTable::getDefaultSortField ( )
Returns
string

Definition at line 1065 of file class.ilDataCollectionTable.php.

References $default_sort_field.

Referenced by cloneStructure(), doCreate(), and doUpdate().

+ Here is the caller graph for this function:

◆ getDefaultSortFieldOrder()

ilDataCollectionTable::getDefaultSortFieldOrder ( )
Returns
string

Definition at line 1084 of file class.ilDataCollectionTable.php.

References $default_sort_field_order.

Referenced by cloneStructure(), doCreate(), and doUpdate().

+ Here is the caller graph for this function:

◆ getDeletePerm()

ilDataCollectionTable::getDeletePerm ( )
Returns
boolean

Definition at line 933 of file class.ilDataCollectionTable.php.

References $delete_perm.

Referenced by cloneStructure(), doCreate(), doUpdate(), hasPermissionToDeleteRecord(), and hasPermissionToDeleteRecords().

933  {
934 
935  return (bool) $this->delete_perm;
936  }
+ Here is the caller graph for this function:

◆ getDescription()

ilDataCollectionTable::getDescription ( )
Returns
string

Definition at line 1046 of file class.ilDataCollectionTable.php.

References $description.

Referenced by cloneStructure(), doCreate(), and doUpdate().

1046  {
1047  return $this->description;
1048  }
+ Here is the caller graph for this function:

◆ getEditableFields()

ilDataCollectionTable::getEditableFields ( )
Returns
array

Definition at line 623 of file class.ilDataCollectionTable.php.

References $fields, and getRecordFields().

623  {
624  $fields = $this->getRecordFields();
625  $editableFields = array();
626 
627  foreach ($fields as $field) {
628  if (! $field->getLocked()) {
629  $editableFields[] = $field;
630  }
631  }
632 
633  return $editableFields;
634  }
getRecordFields()
Returns all fields of this table which are NOT standard fields.
+ Here is the call graph for this function:

◆ getEditByOwner()

ilDataCollectionTable::getEditByOwner ( )
Returns
boolean

Definition at line 950 of file class.ilDataCollectionTable.php.

References $edit_by_owner.

Referenced by cloneStructure(), doCreate(), doUpdate(), hasPermissionToDeleteRecord(), and hasPermissionToEditRecord().

950  {
951  return (bool) $this->edit_by_owner;
952  }
+ Here is the caller graph for this function:

◆ getEditPerm()

ilDataCollectionTable::getEditPerm ( )
Returns
boolean

Definition at line 966 of file class.ilDataCollectionTable.php.

References $edit_perm.

Referenced by cloneStructure(), doCreate(), doUpdate(), and hasPermissionToEditRecord().

966  {
967  return (bool) $this->edit_perm;
968  }
+ Here is the caller graph for this function:

◆ getExportableFields()

ilDataCollectionTable::getExportableFields ( )

Return all the fields that are marked as exportable.

Returns
array ilDataCollectionField

Definition at line 662 of file class.ilDataCollectionTable.php.

References $fields, and getFields().

662  {
663  $fields = $this->getFields();
664  $exportableFields = array();
665  foreach ($fields as $field) {
666  if ($field->getExportable()) {
667  $exportableFields[] = $field;
668  }
669  }
670 
671  return $exportableFields;
672  }
getFields()
Returns all fields of this table including the standard fields.
+ Here is the call graph for this function:

◆ getExportEnabled()

ilDataCollectionTable::getExportEnabled ( )
Returns
boolean

Definition at line 1279 of file class.ilDataCollectionTable.php.

References $export_enabled.

Referenced by cloneStructure(), doCreate(), and doUpdate().

1279  {
1280  return $this->export_enabled;
1281  }
+ Here is the caller graph for this function:

◆ getField()

ilDataCollectionTable::getField (   $field_id)
Parameters
$field_id
Returns
ilDataCollectionField|null

Definition at line 456 of file class.ilDataCollectionTable.php.

References $fields, and getFields().

Referenced by getPartialRecords().

456  {
457  $fields = $this->getFields();
458  $field = NULL;
459  foreach ($fields as $field_1) {
460  if ($field_1->getId() == $field_id) {
461  $field = $field_1;
462  }
463  }
464 
465  return $field;
466  }
getFields()
Returns all fields of this table including the standard fields.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFieldByTitle()

ilDataCollectionTable::getFieldByTitle (   $title)

Get a field by title.

Parameters
$title
Returns
ilDataCollectionField

Definition at line 893 of file class.ilDataCollectionTable.php.

References $title, and getFields().

Referenced by getPartialRecords().

893  {
894  $return = NULL;
895  foreach ($this->getFields() as $field) {
896  if ($field->getTitle() == $title) {
897  $return = $field;
898  break;
899  }
900  }
901 
902  return $return;
903  }
getFields()
Returns all fields of this table including the standard fields.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFieldIds()

ilDataCollectionTable::getFieldIds ( )
Returns
array

Definition at line 472 of file class.ilDataCollectionTable.php.

References getFields().

472  {
473  return array_keys($this->getFields());
474  }
getFields()
Returns all fields of this table including the standard fields.
+ Here is the call graph for this function:

◆ getFields()

ilDataCollectionTable::getFields ( )

Returns all fields of this table including the standard fields.

Returns
ilDataCollectionField[]

Definition at line 522 of file class.ilDataCollectionTable.php.

References $fields, $stdFields, ilDataCollectionStandardField\_getStandardFields(), fields, getPublicCommentsEnabled(), ilDataCollectionDatatype\INPUTFORMAT_BOOLEAN, ilDataCollectionDatatype\INPUTFORMAT_FILE, ilDataCollectionDatatype\INPUTFORMAT_FORMULA, ilDataCollectionDatatype\INPUTFORMAT_ILIAS_REF, ilDataCollectionDatatype\INPUTFORMAT_MOB, ilDataCollectionDatatype\INPUTFORMAT_RATING, ilDataCollectionDatatype\INPUTFORMAT_REFERENCE, ilDataCollectionDatatype\INPUTFORMAT_REFERENCELIST, loadFields(), and sortByOrder().

Referenced by buildOrderFields(), cloneStructure(), getExportableFields(), getField(), getFieldByTitle(), getFieldIds(), getFilterableFields(), getNewOrder(), getVisibleFields(), and updateFields().

522  {
523  $this->loadFields();
524  $this->stdFields = $this->getStandardFields();
525  $fields = array_merge($this->fields, $this->stdFields);
526  $this->sortByOrder($fields);
527 
528  return $fields;
529  }
$errors fields
Definition: imgupload.php:48
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFilterableFields()

ilDataCollectionTable::getFilterableFields ( )

getFilterableFields Returns all fields of this table who have set their filterable to true, including standard fields.

Returns
ilDataCollectionField[]

Definition at line 643 of file class.ilDataCollectionTable.php.

References $fields, and getFields().

643  {
644  $fields = $this->getFields();
645  $filterableFields = array();
646 
647  foreach ($fields as $field) {
648  if ($field->isFilterable()) {
649  $filterableFields[] = $field;
650  }
651  }
652 
653  return $filterableFields;
654  }
getFields()
Returns all fields of this table including the standard fields.
+ Here is the call graph for this function:

◆ getId()

ilDataCollectionTable::getId ( )

Get table id.

Returns
int

Definition at line 306 of file class.ilDataCollectionTable.php.

References $id.

Referenced by cloneStructure(), doCreate(), doRead(), doUpdate(), getPartialRecords(), ilDataCollectionRecordViewGUI\hasTableValidViewDefinition(), and loadFields().

306  {
307  return $this->id;
308  }
+ Here is the caller graph for this function:

◆ getIsVisible()

ilDataCollectionTable::getIsVisible ( )
Returns
boolean

Definition at line 1030 of file class.ilDataCollectionTable.php.

References $is_visible.

Referenced by cloneStructure(), doCreate(), and doUpdate().

1030  {
1031  return $this->is_visible;
1032  }
+ Here is the caller graph for this function:

◆ getLimited()

ilDataCollectionTable::getLimited ( )
Returns
boolean

Definition at line 982 of file class.ilDataCollectionTable.php.

References $limited.

Referenced by checkLimit(), cloneStructure(), doCreate(), and doUpdate().

982  {
983  return $this->limited;
984  }
+ Here is the caller graph for this function:

◆ getLimitEnd()

ilDataCollectionTable::getLimitEnd ( )
Returns
string

Definition at line 998 of file class.ilDataCollectionTable.php.

References $limit_end.

Referenced by checkLimit(), cloneStructure(), doCreate(), and doUpdate().

998  {
999  return $this->limit_end;
1000  }
+ Here is the caller graph for this function:

◆ getLimitStart()

ilDataCollectionTable::getLimitStart ( )
Returns
string

Definition at line 1014 of file class.ilDataCollectionTable.php.

References $limit_start.

Referenced by checkLimit(), cloneStructure(), doCreate(), and doUpdate().

1014  {
1015  return $this->limit_start;
1016  }
+ Here is the caller graph for this function:

◆ getNewOrder()

ilDataCollectionTable::getNewOrder ( )

getNewOrder

Returns
int returns the place where a new field should be placed.

Definition at line 504 of file class.ilDataCollectionTable.php.

References $fields, and getFields().

504  {
505  $fields = $this->getFields();
506  $place = 0;
507  foreach ($fields as $field) {
508  if (! $field->isStandardField()) {
509  $place = $field->getOrder() + 1;
510  }
511  }
512 
513  return $place;
514  }
getFields()
Returns all fields of this table including the standard fields.
+ Here is the call graph for this function:

◆ getObjId()

ilDataCollectionTable::getObjId ( )
Returns
int

Definition at line 322 of file class.ilDataCollectionTable.php.

References $objId.

Referenced by doCreate(), doUpdate(), and getPartialRecords().

322  {
323  return $this->objId;
324  }
+ Here is the caller graph for this function:

◆ getPartialRecords()

ilDataCollectionTable::getPartialRecords (   $sort,
  $direction,
  $limit,
  $offset,
array  $filter = array() 
)

Return only the needed subset of record objects for the table, according to sorting, paging and filters.

Parameters
string$sortTitle of a field where the ilTable2GUI is sorted
string$direction'desc' or 'asc'
int$limitLimit of records
int$offsetOffset from records
array$filterContaining the filter values
Returns
array Array with two keys: 'record' => Contains the record objects, 'total' => Number of total records (without slicing)

Definition at line 1312 of file class.ilDataCollectionTable.php.

References $_SESSION, $id, $ilDB, $ilUser, $records, ilObject\_getAllReferences(), getField(), getFieldByTitle(), ilDataCollectionCache\getFieldCache(), getId(), getObjId(), ilDataCollectionCache\getRecordCache(), ilDataCollectionCache\getRecordFieldCache(), getViewOwnRecordsPerm(), ilObjDataCollectionAccess\hasWriteAccess(), ilDataCollectionDatatype\INPUTFORMAT_BOOLEAN, ilDataCollectionDatatype\INPUTFORMAT_DATETIME, ilDataCollectionDatatype\INPUTFORMAT_FILE, ilDataCollectionDatatype\INPUTFORMAT_FORMULA, ilDataCollectionDatatype\INPUTFORMAT_ILIAS_REF, ilDataCollectionDatatype\INPUTFORMAT_MOB, ilDataCollectionDatatype\INPUTFORMAT_NUMBER, ilDataCollectionDatatype\INPUTFORMAT_RATING, ilDataCollectionDatatype\INPUTFORMAT_REFERENCE, ilDataCollectionDatatype\INPUTFORMAT_TEXT, and ilDataCollectionField\PROPERTYID_N_REFERENCE.

1312  {
1313  global $ilDB, $ilUser, $rbacreview;
1314 
1315  $sort_field = ($sort) ? $this->getFieldByTitle($sort) : $this->getField('id');
1316  $direction = strtolower($direction);
1317  $direction = (in_array($direction, array( 'desc', 'asc' ))) ? $direction : 'asc';
1318 
1319  // Sorting by a status from an ILIAS Ref field. This column is added dynamically to the table, there is no field model
1320  $sort_by_status = false;
1321  if (substr($sort, 0, 8) == '_status_') {
1322  $sort_by_status = true;
1323  $sort_field = $this->getFieldByTitle(substr($sort, 8));
1324  }
1325 
1326  if (is_null($sort_field)) {
1327  $sort_field = $this->getField('id');
1328  }
1329 
1330  $id = $sort_field->getId();
1331  $stl = $sort_field->getStorageLocation();
1332  $select_str = '';
1333  $join_str = '';
1334  $where_additions = '';
1335  $has_nref = false;
1336 
1337  if ($sort_field->isStandardField()) {
1338  if ($id == 'owner' || $id == 'last_edit_by') {
1339  $join_str .= "LEFT JOIN usr_data AS sort_usr_data_{$id} ON (sort_usr_data_{$id}.usr_id = record.{$id})";
1340  $select_str .= " sort_usr_data_{$id}.login AS field_{$id},";
1341  } elseif ($id != 'comments') {
1342  $select_str .= " record.{$id} AS field_{$id},";
1343  }
1344  } else {
1345  switch ($sort_field->getDatatypeId()) {
1347  $rating_joined = true;
1348  // FSX Bugfix 0015735: The average is multiplied with 10000 and added to the amount of votes
1349  $join_str .= "LEFT JOIN (SELECT (ROUND(AVG(rating), 1) * 10000 + COUNT(rating)) as rating, obj_id FROM il_rating GROUP BY obj_id) AS average ON average.obj_id = record.id";
1350  $select_str .= " average.rating AS field_{$id},";
1351  break;
1353  $join_str .=
1354  "LEFT JOIN il_dcl_record_field AS sort_record_field_{$id} ON (sort_record_field_{$id}.record_id = record.id AND sort_record_field_{$id}.field_id = "
1355  . $ilDB->quote($sort_field->getId(), 'integer') . ") ";
1356  $join_str .= "LEFT JOIN il_dcl_stloc{$stl}_value AS sort_stloc_{$id} ON (sort_stloc_{$id}.record_field_id = sort_record_field_{$id}.id) ";
1357  $join_str .= "LEFT JOIN object_reference AS sort_object_reference_{$id} ON (sort_object_reference_{$id}.ref_id = sort_stloc_{$id}.value AND sort_object_reference_{$id}.deleted IS NULL)";
1358  $join_str .= "LEFT JOIN object_data AS sort_object_data_{$id} ON (sort_object_data_{$id}.obj_id = sort_object_reference_{$id}.obj_id)";
1359  if ($sort_by_status) {
1360  global $ilUser;
1361  $join_str .= "LEFT JOIN ut_lp_marks AS ut ON (ut.obj_id = sort_object_data_{$id}.obj_id AND ut.usr_id = "
1362  . $ilDB->quote($ilUser->getId(), 'integer') . ") ";
1363  }
1364  $select_str .= (! $sort_by_status) ? " sort_object_data_{$id}.title AS field_{$id}," : " ut.status AS field_{$id}";
1365  break;
1368  $join_str .=
1369  "LEFT JOIN il_dcl_record_field AS sort_record_field_{$id} ON (sort_record_field_{$id}.record_id = record.id AND sort_record_field_{$id}.field_id = "
1370  . $ilDB->quote($sort_field->getId(), 'integer') . ") ";
1371  $join_str .= "LEFT JOIN il_dcl_stloc{$stl}_value AS sort_stloc_{$id} ON (sort_stloc_{$id}.record_field_id = sort_record_field_{$id}.id) ";
1372  $join_str .= "LEFT JOIN object_data AS sort_object_data_{$id} ON (sort_object_data_{$id}.obj_id = sort_stloc_{$id}.value) ";
1373  $select_str .= " sort_object_data_{$id}.title AS field_{$id},";
1374  break;
1376  $prop = $sort_field->getPropertyvalues();
1377  $ref_field = ilDataCollectionCache::getFieldCache($sort_field->getFieldRef());
1379  if ($n_ref) {
1380  $has_nref = true;
1381  }
1382  $select_str .= ($n_ref) ? " GROUP_CONCAT(stloc_{$id}_joined.value) AS field_{$id}" : "stloc_{$id}_joined.value AS field_{$id},";
1383  $join_str .=
1384  "LEFT JOIN il_dcl_record_field AS record_field_{$id} ON (record_field_{$id}.record_id = record.id AND record_field_{$id}.field_id = "
1385  . $ilDB->quote($sort_field->getId(), 'integer') . ") ";
1386  $join_str .= "LEFT JOIN il_dcl_stloc{$stl}_value AS stloc_{$id} ON (stloc_{$id}.record_field_id = record_field_{$id}.id) ";
1387  $join_str .=
1388  "LEFT JOIN il_dcl_record_field AS record_field_{$id}_joined ON (record_field_{$id}_joined.record_id = stloc_{$id}.value AND record_field_{$id}_joined.field_id = "
1389  . $ilDB->quote($ref_field->getId(), 'integer') . ") ";
1390  $join_str .= "LEFT JOIN il_dcl_stloc{$ref_field->getStorageLocation()}_value AS stloc_{$id}_joined ON (stloc_{$id}_joined.record_field_id = record_field_{$id}_joined.id) ";
1391  break;
1396  $select_str .= " sort_stloc_{$id}.value AS field_{$id},";
1397  $join_str .=
1398  "LEFT JOIN il_dcl_record_field AS sort_record_field_{$id} ON (sort_record_field_{$id}.record_id = record.id AND sort_record_field_{$id}.field_id = "
1399  . $ilDB->quote($sort_field->getId(), 'integer') . ") ";
1400  $join_str .= "LEFT JOIN il_dcl_stloc{$stl}_value AS sort_stloc_{$id} ON (sort_stloc_{$id}.record_field_id = sort_record_field_{$id}.id) ";
1401  break;
1402  }
1403  }
1404 
1405  if (count($filter)) {
1406  foreach ($filter as $key => $filter_value) {
1407  $filter_field_id = substr($key, 7);
1408  $filter_field = $this->getField($filter_field_id);
1409  switch ($filter_field->getDatatypeId()) {
1411  if(!$rating_joined) {
1412  $join_str .= "LEFT JOIN (SELECT (ROUND(AVG(rating), 1) * 10000 + COUNT(rating)) as rating, obj_id FROM il_rating GROUP BY obj_id) AS average ON average.obj_id = record.id";
1413  }
1414  // FSX Bugfix 0015735: The average is multiplied with 10000 and added to the amount of votes
1415  $where_additions .= " AND average.rating >= " . $ilDB->quote($filter_value * 10000, 'integer');
1416  break;
1418  $join_str .=
1419  "INNER JOIN il_dcl_record_field AS filter_record_field_{$filter_field_id} ON (filter_record_field_{$filter_field_id}.record_id = record.id AND filter_record_field_{$filter_field_id}.field_id = "
1420  . $ilDB->quote($filter_field_id, 'integer') . ") ";
1421  $join_str .= "INNER JOIN il_dcl_stloc{$filter_field->getStorageLocation()}_value AS filter_stloc_{$filter_field_id} ON (filter_stloc_{$filter_field_id}.record_field_id = filter_record_field_{$filter_field_id}.id) ";
1422  $join_str .= "INNER JOIN object_reference AS filter_object_reference_{$filter_field_id} ON (filter_object_reference_{$filter_field_id}.ref_id = filter_stloc_{$filter_field_id}.value ) ";
1423  $join_str .=
1424  "INNER JOIN object_data AS filter_object_data_{$filter_field_id} ON (filter_object_data_{$filter_field_id}.obj_id = filter_object_reference_{$filter_field_id}.obj_id AND filter_object_data_{$filter_field_id}.title LIKE "
1425  . $ilDB->quote("%$filter_value%", 'text') . ") ";
1426  break;
1429  $join_str .=
1430  "INNER JOIN il_dcl_record_field AS filter_record_field_{$filter_field_id} ON (filter_record_field_{$filter_field_id}.record_id = record.id AND filter_record_field_{$filter_field_id}.field_id = "
1431  . $ilDB->quote($filter_field_id, 'integer') . ") ";
1432  $join_str .= "INNER JOIN il_dcl_stloc{$filter_field->getStorageLocation()}_value AS filter_stloc_{$filter_field_id} ON (filter_stloc_{$filter_field_id}.record_field_id = filter_record_field_{$filter_field_id}.id) ";
1433  $join_str .=
1434  "INNER JOIN object_data AS filter_object_data_{$filter_field_id} ON (filter_object_data_{$filter_field_id}.obj_id = filter_stloc_{$filter_field_id}.value AND filter_object_data_{$filter_field_id}.title LIKE "
1435  . $ilDB->quote("%$filter_value%", 'text') . ") ";
1436  break;
1438  $date_from = (isset($filter_value['from']) && is_object($filter_value['from'])) ? $filter_value['from'] : NULL;
1439  $date_to = (isset($filter_value['to']) && is_object($filter_value['to'])) ? $filter_value['to'] : NULL;
1440  if ($filter_field->isStandardField()) {
1441  if ($date_from) {
1442  $where_additions .= " AND (record.{$filter_field_id} >= " . $ilDB->quote($date_from, 'date') . ")";
1443  }
1444  if ($date_to) {
1445  $where_additions .= " AND (record.{$filter_field_id} <= " . $ilDB->quote($date_to, 'date') . ")";
1446  }
1447  } else {
1448  $join_str .=
1449  "INNER JOIN il_dcl_record_field AS filter_record_field_{$filter_field_id} ON (filter_record_field_{$filter_field_id}.record_id = record.id AND filter_record_field_{$filter_field_id}.field_id = "
1450  . $ilDB->quote($filter_field_id, 'integer') . ") ";
1451  $join_str .= "INNER JOIN il_dcl_stloc{$filter_field->getStorageLocation()}_value AS filter_stloc_{$filter_field_id} ON (filter_stloc_{$filter_field_id}.record_field_id = filter_record_field_{$filter_field_id}.id ";
1452  if ($date_from) {
1453  $join_str .= "AND filter_stloc_{$filter_field_id}.value >= " . $ilDB->quote($date_from, 'date') . " ";
1454  }
1455  if ($date_to) {
1456  $join_str .= "AND filter_stloc_{$filter_field_id}.value <= " . $ilDB->quote($date_to, 'date') . " ";
1457  }
1458  $join_str .= ") ";
1459  }
1460  break;
1462  $from = (isset($filter_value['from'])) ? (int)$filter_value['from'] : NULL;
1463  $to = (isset($filter_value['to'])) ? (int)$filter_value['to'] : NULL;
1464  if ($filter_field->isStandardField()) {
1465  if (! is_null($from)) {
1466  $where_additions .= " AND record.{$filter_field_id} >= " . $ilDB->quote($from, 'integer');
1467  }
1468  if (! is_null($to)) {
1469  $where_additions .= " AND record.{$filter_field_id} <= " . $ilDB->quote($to, 'integer');
1470  }
1471  } else {
1472  $join_str .=
1473  "INNER JOIN il_dcl_record_field AS filter_record_field_{$filter_field_id} ON (filter_record_field_{$filter_field_id}.record_id = record.id AND filter_record_field_{$filter_field_id}.field_id = "
1474  . $ilDB->quote($filter_field_id, 'integer') . ") ";
1475  $join_str .= "INNER JOIN il_dcl_stloc{$filter_field->getStorageLocation()}_value AS filter_stloc_{$filter_field_id} ON (filter_stloc_{$filter_field_id}.record_field_id = filter_record_field_{$filter_field_id}.id";
1476  if (! is_null($from)) {
1477  $join_str .= " AND filter_stloc_{$filter_field_id}.value >= " . $ilDB->quote($from, 'integer');
1478  }
1479  if (! is_null($to)) {
1480  $join_str .= " AND filter_stloc_{$filter_field_id}.value <= " . $ilDB->quote($to, 'integer');
1481  }
1482  $join_str .= ") ";
1483  }
1484  break;
1486  if ($filter_value == "checked") {
1487  $join_str .=
1488  "INNER JOIN il_dcl_record_field AS filter_record_field_{$filter_field_id} ON (filter_record_field_{$filter_field_id}.record_id = record.id AND filter_record_field_{$filter_field_id}.field_id = "
1489  . $ilDB->quote($filter_field_id, 'integer') . ") ";
1490  $join_str .= "INNER JOIN il_dcl_stloc{$filter_field->getStorageLocation()}_value AS filter_stloc_{$filter_field_id} ON (filter_stloc_{$filter_field_id}.record_field_id = filter_record_field_{$filter_field_id}.id";
1491  $join_str .= " AND filter_stloc_{$filter_field_id}.value = " . $ilDB->quote(1, 'integer');
1492  } else {
1493  $join_str .=
1494  "INNER JOIN il_dcl_record_field AS filter_record_field_{$filter_field_id} ON (filter_record_field_{$filter_field_id}.record_id = record.id AND filter_record_field_{$filter_field_id}.field_id = "
1495  . $ilDB->quote($filter_field_id, 'integer') . ") ";
1496  $join_str .= "LEFT JOIN il_dcl_stloc{$filter_field->getStorageLocation()}_value AS filter_stloc_{$filter_field_id} ON (filter_stloc_{$filter_field_id}.record_field_id = filter_record_field_{$filter_field_id}.id";
1497  $where_additions .= " AND (filter_stloc_{$filter_field_id}.value <> " . $ilDB->quote(1, 'integer')
1498  . " OR filter_stloc_{$filter_field_id}.value is NULL)";
1499  }
1500  $join_str .= " ) ";
1501  break;
1503  if ($filter_field->isStandardField()) {
1504  $join_str .=
1505  "INNER JOIN usr_data AS filter_usr_data_{$filter_field_id} ON (filter_usr_data_{$filter_field_id}.usr_id = record.{$filter_field_id} AND filter_usr_data_{$filter_field_id}.login LIKE "
1506  . $ilDB->quote("%$filter_value%", 'text') . ") ";
1507  } else {
1508  $join_str .=
1509  " INNER JOIN il_dcl_record_field AS filter_record_field_{$filter_field_id} ON (filter_record_field_{$filter_field_id}.record_id = record.id AND filter_record_field_{$filter_field_id}.field_id = "
1510  . $ilDB->quote($filter_field_id, 'integer') . ") ";
1511  $join_str .=
1512  " INNER JOIN il_dcl_stloc{$filter_field->getStorageLocation()}_value AS filter_stloc_{$filter_field_id} ON (filter_stloc_{$filter_field_id}.record_field_id = filter_record_field_{$filter_field_id}.id AND filter_stloc_{$filter_field_id}.value LIKE "
1513  . $ilDB->quote("%$filter_value%", 'text') . ") ";
1514  }
1515  break;
1517  $join_str .=
1518  " INNER JOIN il_dcl_record_field AS filter_record_field_{$filter_field_id} ON (filter_record_field_{$filter_field_id}.record_id = record.id AND filter_record_field_{$filter_field_id}.field_id = "
1519  . $ilDB->quote($filter_field_id, 'integer') . ") ";
1520  $prop = $filter_field->getPropertyvalues();
1522  if ($n_ref) {
1523  $join_str .=
1524  " INNER JOIN il_dcl_stloc{$filter_field->getStorageLocation()}_value AS filter_stloc_{$filter_field_id} ON (filter_stloc_{$filter_field_id}.record_field_id = filter_record_field_{$filter_field_id}.id AND filter_stloc_{$filter_field_id}.value LIKE "
1525  . $ilDB->quote("%$filter_value%", 'text') . ") ";
1526  } else {
1527  $join_str .=
1528  " INNER JOIN il_dcl_stloc{$filter_field->getStorageLocation()}_value AS filter_stloc_{$filter_field_id} ON (filter_stloc_{$filter_field_id}.record_field_id = filter_record_field_{$filter_field_id}.id AND filter_stloc_{$filter_field_id}.value = "
1529  . $ilDB->quote($filter_value, 'integer') . ") ";
1530  }
1531  break;
1532  }
1533  }
1534  }
1535 
1536  // Build the query string
1537  $sql = "SELECT DISTINCT record.id, record.owner";
1538  if($select_str) {
1539  $sql .= ', ';
1540  }
1541  $sql .= rtrim($select_str, ',') . " FROM il_dcl_record AS record ";
1542  $sql .= $join_str;
1543  $sql .= " WHERE record.table_id = " . $ilDB->quote($this->getId(), 'integer') . $where_additions;
1544  if ($has_nref) {
1545  $sql .= " GROUP BY record.id, record.owner";
1546  }
1547  if($id != 'comments' && $sort_field->getDatatypeId() != ilDataCollectionDatatype::INPUTFORMAT_FORMULA) {
1548  $sql .= " ORDER BY field_{$id} {$direction}";
1549  }
1550  $set = $ilDB->query($sql);
1551  $total_record_ids = array();
1552  // Save record-ids in session to enable prev/next links in detail view
1553  $_SESSION['dcl_record_ids'] = array();
1554  $_SESSION['dcl_table_id'] = $this->getId();
1555  $is_allowed_to_view = ilObjDataCollectionAccess::hasWriteAccess(array_pop(ilObject::_getAllReferences($this->getObjId())));
1556  while ($rec = $ilDB->fetchAssoc($set)) {
1557  // Quick check if the current user is allowed to view the record
1558  if (!$is_allowed_to_view && ($this->getViewOwnRecordsPerm() && $ilUser->getId() != $rec['owner'])) {
1559  continue;
1560  }
1561  $total_record_ids[] = $rec['id'];
1562  $_SESSION['dcl_record_ids'][] = $rec['id'];
1563  }
1564  // Sort by formula
1565  if ($sort_field->getDatatypeId() == ilDataCollectionDatatype::INPUTFORMAT_FORMULA) {
1566  $sort_array = array();
1567  foreach ($total_record_ids as $id) {
1568  $formula_field = ilDataCollectionCache::getRecordFieldCache(new ilDataCollectionRecord($id), $sort_field);
1569  $sort_array[$id] = $formula_field->getValue();
1570  }
1571  switch ($direction) {
1572  case 'asc':
1573  case 'ASC':
1574  asort($sort_array);
1575  break;
1576  case 'desc':
1577  case 'DESC':
1578  arsort($sort_array);
1579  break;
1580  }
1581  $total_record_ids = array_keys($sort_array);
1582  }
1583  // Now slice the array to load only the needed records in memory
1584  $record_ids = array_slice($total_record_ids, $offset, $limit);
1585  $records = array();
1586  foreach ($record_ids as $id) {
1588  }
1589 
1590  return array( 'records' => $records, 'total' => count($total_record_ids) );
1591  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static getRecordCache($record_id=0)
static _getAllReferences($a_id)
get all reference ids of object
Class ilDataCollectionRecord.
static getRecordFieldCache($record, $field)
global $ilUser
Definition: imgupload.php:15
global $ilDB
getFieldByTitle($title)
Get a field by title.
+ Here is the call graph for this function:

◆ getPublicCommentsEnabled()

ilDataCollectionTable::getPublicCommentsEnabled ( )
Returns
boolean

Definition at line 1100 of file class.ilDataCollectionTable.php.

References $public_comments.

Referenced by cloneStructure(), doCreate(), doUpdate(), and getFields().

+ Here is the caller graph for this function:

◆ getRecordFields()

ilDataCollectionTable::getRecordFields ( )

Returns all fields of this table which are NOT standard fields.

Returns
ilDataCollectionField[]

Definition at line 593 of file class.ilDataCollectionTable.php.

References $fields, and loadFields().

Referenced by doRead(), and getEditableFields().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRecords()

ilDataCollectionTable::getRecords ( )
Returns
ilDataCollectionRecord[]

Definition at line 363 of file class.ilDataCollectionTable.php.

References $records, and loadRecords().

Referenced by _hasRecords(), deleteField(), doRead(), and getRecordsByFilter().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRecordsByFilter()

ilDataCollectionTable::getRecordsByFilter ( array  $filter = array())

getRecordsByFilter

Parameters
$filterfilter is of the form array("filter_{field_id}" => filter); For dates and integers this filter must be of the form array("from" => from, "to" => to). In case of dates from and to have to be ilDateTime objects in case of integers they have to be integers as well.
Returns
ilDataCollectionRecord[]

Definition at line 381 of file class.ilDataCollectionTable.php.

References $records, getRecords(), and loadRecords().

381  {
382  $this->loadRecords();
383  // Only pass records trough filter if there is filtering required #performance-improvements
384  if (! count($filter)) {
385  return $this->records;
386  }
387  $filtered = array();
388  foreach ($this->getRecords() as $record) {
389  if ($record->passThroughFilter($filter)) {
390  $filtered[] = $record;
391  }
392  }
393 
394  return $filtered;
395  }
+ Here is the call graph for this function:

◆ getTitle()

ilDataCollectionTable::getTitle ( )
Returns
string

Definition at line 338 of file class.ilDataCollectionTable.php.

References $title.

Referenced by cloneStructure(), doCreate(), and doUpdate().

338  {
339  return $this->title;
340  }
+ Here is the caller graph for this function:

◆ getViewOwnRecordsPerm()

ilDataCollectionTable::getViewOwnRecordsPerm ( )
Returns
boolean

Definition at line 1116 of file class.ilDataCollectionTable.php.

References $view_own_records_perm.

Referenced by cloneStructure(), doCreate(), doUpdate(), getPartialRecords(), and hasPermissionToDeleteRecords().

1116  {
1117  return (bool)$this->view_own_records_perm;
1118  }
+ Here is the caller graph for this function:

◆ getVisibleFields()

ilDataCollectionTable::getVisibleFields ( )

Returns all fields of this table who have set their visibility to true, including standard fields.

Returns
ilDataCollectionField[]

Definition at line 605 of file class.ilDataCollectionTable.php.

References $fields, and getFields().

605  {
606  $fields = $this->getFields();
607 
608  $visibleFields = array();
609 
610  foreach ($fields as $field) {
611  if ($field->isVisible()) {
612  $visibleFields[] = $field;
613  }
614  }
615 
616  return $visibleFields;
617  }
getFields()
Returns all fields of this table including the standard fields.
+ Here is the call graph for this function:

◆ hasCustomFields()

ilDataCollectionTable::hasCustomFields ( )

hasCustomFields

Returns
boolean

Definition at line 1126 of file class.ilDataCollectionTable.php.

References fields, and loadFields().

1126  {
1127  $this->loadFields();
1128 
1129  return (count($this->fields) > 0) ? true : false;
1130  }
$errors fields
Definition: imgupload.php:48
+ Here is the call graph for this function:

◆ hasPermissionToAddRecord()

ilDataCollectionTable::hasPermissionToAddRecord (   $ref_id)
Parameters
int$ref_idy
Returns
bool

Definition at line 701 of file class.ilDataCollectionTable.php.

References $ref_id, checkLimit(), getAddPerm(), ilObjDataCollectionAccess\hasAddRecordAccess(), and ilObjDataCollectionAccess\hasWriteAccess().

701  {
703  return true;
704  }
706  return false;
707  }
708 
709  return ($this->getAddPerm() AND $this->checkLimit());
710  }
$ref_id
Definition: sahs_server.php:39
+ Here is the call graph for this function:

◆ hasPermissionToAddTable()

ilDataCollectionTable::hasPermissionToAddTable (   $ref_id)
Parameters
int$ref_id
Returns
bool

Definition at line 690 of file class.ilDataCollectionTable.php.

References $ref_id, and ilObjDataCollectionAccess\hasWriteAccess().

+ Here is the call graph for this function:

◆ hasPermissionToDeleteRecord()

ilDataCollectionTable::hasPermissionToDeleteRecord (   $ref_id,
ilDataCollectionRecord  $record 
)
Parameters
$ref_idint the reference id of the current datacollection object
$recordilDataCollectionRecord the record which will be deleted
Returns
bool

Definition at line 747 of file class.ilDataCollectionTable.php.

References $ref_id, checkEditByOwner(), checkLimit(), getDeletePerm(), getEditByOwner(), ilObjDataCollectionAccess\hasAddRecordAccess(), and ilObjDataCollectionAccess\hasWriteAccess().

747  {
749  return true;
750  }
752  return false;
753  }
754  if (!$this->checkLimit()) {
755  return false;
756  }
757  if ($this->getDeletePerm() && !$this->getEditByOwner()) {
758  return true;
759  }
760  if ($this->getEditByOwner()) {
761  // Edit by owner is set... user is only allowed to edit her own entries
762  return $this->checkEditByOwner($record);
763  }
764 
765  return false;
766  }
checkEditByOwner(ilDataCollectionRecord $record)
$ref_id
Definition: sahs_server.php:39
+ Here is the call graph for this function:

◆ hasPermissionToDeleteRecords()

ilDataCollectionTable::hasPermissionToDeleteRecords (   $ref_id)

◆ hasPermissionToEditRecord()

ilDataCollectionTable::hasPermissionToEditRecord (   $ref_id,
ilDataCollectionRecord  $record 
)
Parameters
$ref_idint the reference id of the current datacollection object
$recordilDataCollectionRecord the record which will be edited
Returns
bool

Definition at line 719 of file class.ilDataCollectionTable.php.

References $ref_id, checkEditByOwner(), checkLimit(), getEditByOwner(), getEditPerm(), ilObjDataCollectionAccess\hasAddRecordAccess(), and ilObjDataCollectionAccess\hasWriteAccess().

719  {
721  return true;
722  }
724  return false;
725  }
726  if (!$this->checkLimit()) {
727  return false;
728  }
729  if ($this->getEditPerm() && !$this->getEditByOwner()) {
730  return true;
731  }
732  if ($this->getEditByOwner()) {
733  // Edit by owner is set... user is only allowed to edit her own entries
734  return $this->checkEditByOwner($record);
735  }
736 
737  return false;
738  }
checkEditByOwner(ilDataCollectionRecord $record)
$ref_id
Definition: sahs_server.php:39
+ Here is the call graph for this function:

◆ hasPermissionToFields()

ilDataCollectionTable::hasPermissionToFields (   $ref_id)
Parameters
int$ref_id
Returns
bool

Definition at line 680 of file class.ilDataCollectionTable.php.

References $ref_id, and ilObjDataCollectionAccess\hasWriteAccess().

+ Here is the call graph for this function:

◆ loadFields()

ilDataCollectionTable::loadFields ( )
protected

Definition at line 477 of file class.ilDataCollectionTable.php.

References $fields, $ilDB, $query, ilDataCollectionCache\buildFieldFromRecord(), fields, getId(), and sortByOrder().

Referenced by getFields(), getRecordFields(), and hasCustomFields().

477  {
478  if ($this->fields == NULL) {
479  global $ilDB;
480 
481  $query = "SELECT DISTINCT field.* FROM il_dcl_field AS field
482  INNER JOIN il_dcl_view AS view ON view.table_id = field.table_id
483  INNER JOIN il_dcl_viewdefinition AS def ON def.view_id = view.id
484  WHERE field.table_id =" . $ilDB->quote($this->getId(), "integer") . "
485  ORDER BY def.field_order DESC";
486  $fields = array();
487  $set = $ilDB->query($query);
488 
489  while ($rec = $ilDB->fetchAssoc($set)) {
491  $fields[$field->getId()] = $field;
492  }
493  $this->sortByOrder($fields);
494  $this->fields = $fields;
495  }
496  }
$errors fields
Definition: imgupload.php:48
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadObj()

ilDataCollectionTable::loadObj ( )
protected

Definition at line 353 of file class.ilDataCollectionTable.php.

Referenced by getCollectionObject().

353  {
354  if ($this->obj == NULL) {
355  $this->obj = new ilObjDataCollection($this->objId, false);
356  }
357  }
Class ilObjDataCollection.
+ Here is the caller graph for this function:

◆ loadRecords()

ilDataCollectionTable::loadRecords ( )
protected

Definition at line 398 of file class.ilDataCollectionTable.php.

References $ilDB, $query, $records, and ilDataCollectionCache\getRecordCache().

Referenced by getRecords(), and getRecordsByFilter().

398  {
399  if ($this->records == NULL) {
400  global $ilDB;
401 
402  $records = array();
403  $query = "SELECT id FROM il_dcl_record WHERE table_id = " . $ilDB->quote($this->id, "integer");
404  $set = $ilDB->query($query);
405 
406  while ($rec = $ilDB->fetchAssoc($set)) {
407  $records[$rec['id']] = ilDataCollectionCache::getRecordCache($rec['id']);
408  }
409 
410  $this->records = $records;
411  }
412  }
static getRecordCache($record_id=0)
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAddPerm()

ilDataCollectionTable::setAddPerm (   $add_perm)
Parameters
boolean$add_perm

Definition at line 909 of file class.ilDataCollectionTable.php.

References $add_perm.

Referenced by cloneStructure(), and doRead().

909  {
910  $this->add_perm = $add_perm;
911  }
+ Here is the caller graph for this function:

◆ setDefaultSortField()

ilDataCollectionTable::setDefaultSortField (   $default_sort_field)

/**

Parameters
string$default_sort_field

Definition at line 1056 of file class.ilDataCollectionTable.php.

References $default_sort_field.

Referenced by cloneStructure(), and doRead().

1056  {
1057  $default_sort_field = ($default_sort_field) ? $default_sort_field : 0; // Change null or empty strings to zero
1058  $this->default_sort_field = $default_sort_field;
1059  }
+ Here is the caller graph for this function:

◆ setDefaultSortFieldOrder()

ilDataCollectionTable::setDefaultSortFieldOrder (   $default_sort_field_order)
Parameters
string$default_sort_field_order

Definition at line 1073 of file class.ilDataCollectionTable.php.

References $default_sort_field_order.

Referenced by cloneStructure(), and doRead().

1073  {
1074  if (! in_array($default_sort_field_order, array( 'asc', 'desc' ))) {
1075  $default_sort_field_order = 'asc';
1076  }
1077  $this->default_sort_field_order = $default_sort_field_order;
1078  }
+ Here is the caller graph for this function:

◆ setDeletePerm()

ilDataCollectionTable::setDeletePerm (   $delete_perm)
Parameters
boolean$delete_perm

Definition at line 925 of file class.ilDataCollectionTable.php.

References $delete_perm.

Referenced by cloneStructure(), and doRead().

925  {
926  $this->delete_perm = $delete_perm;
927  }
+ Here is the caller graph for this function:

◆ setDescription()

ilDataCollectionTable::setDescription (   $description)
Parameters
string$description

Definition at line 1038 of file class.ilDataCollectionTable.php.

References $description.

Referenced by cloneStructure(), and doRead().

1038  {
1039  $this->description = $description;
1040  }
+ Here is the caller graph for this function:

◆ setEditByOwner()

ilDataCollectionTable::setEditByOwner (   $edit_by_owner)
Parameters
boolean$edit_by_owner

Definition at line 942 of file class.ilDataCollectionTable.php.

References $edit_by_owner.

Referenced by cloneStructure(), and doRead().

942  {
943  $this->edit_by_owner = $edit_by_owner;
944  }
+ Here is the caller graph for this function:

◆ setEditPerm()

ilDataCollectionTable::setEditPerm (   $edit_perm)
Parameters
boolean$edit_perm

Definition at line 958 of file class.ilDataCollectionTable.php.

References $edit_perm.

Referenced by cloneStructure(), and doRead().

958  {
959  $this->edit_perm = $edit_perm;
960  }
+ Here is the caller graph for this function:

◆ setExportEnabled()

ilDataCollectionTable::setExportEnabled (   $export_enabled)
Parameters
boolean$export_enabled

Definition at line 1271 of file class.ilDataCollectionTable.php.

References $export_enabled.

Referenced by cloneStructure(), and doRead().

1271  {
1272  $this->export_enabled = $export_enabled;
1273  }
+ Here is the caller graph for this function:

◆ setId()

ilDataCollectionTable::setId (   $a_id)

Set table id.

Parameters
int$a_id

Definition at line 296 of file class.ilDataCollectionTable.php.

Referenced by doCreate().

296  {
297  $this->id = $a_id;
298  }
+ Here is the caller graph for this function:

◆ setIsVisible()

ilDataCollectionTable::setIsVisible (   $is_visible)
Parameters
boolean$is_visible

Definition at line 1022 of file class.ilDataCollectionTable.php.

References $is_visible.

Referenced by cloneStructure(), and doRead().

1022  {
1023  $this->is_visible = $is_visible;
1024  }
+ Here is the caller graph for this function:

◆ setLimited()

ilDataCollectionTable::setLimited (   $limited)
Parameters
boolean$limited

Definition at line 974 of file class.ilDataCollectionTable.php.

References $limited.

Referenced by cloneStructure(), and doRead().

974  {
975  $this->limited = $limited;
976  }
+ Here is the caller graph for this function:

◆ setLimitEnd()

ilDataCollectionTable::setLimitEnd (   $limit_end)
Parameters
string$limit_end

Definition at line 990 of file class.ilDataCollectionTable.php.

References $limit_end.

Referenced by cloneStructure(), and doRead().

990  {
991  $this->limit_end = $limit_end;
992  }
+ Here is the caller graph for this function:

◆ setLimitStart()

ilDataCollectionTable::setLimitStart (   $limit_start)
Parameters
string$limit_start

Definition at line 1006 of file class.ilDataCollectionTable.php.

References $limit_start.

Referenced by cloneStructure(), and doRead().

1006  {
1007  $this->limit_start = $limit_start;
1008  }
+ Here is the caller graph for this function:

◆ setObjId()

ilDataCollectionTable::setObjId (   $a_id)
Parameters
$a_id

Definition at line 314 of file class.ilDataCollectionTable.php.

Referenced by doRead().

314  {
315  $this->objId = $a_id;
316  }
+ Here is the caller graph for this function:

◆ setPublicCommentsEnabled()

ilDataCollectionTable::setPublicCommentsEnabled (   $public_comments)
Parameters
boolean$public_comments

Definition at line 1092 of file class.ilDataCollectionTable.php.

References $public_comments.

Referenced by cloneStructure(), and doRead().

1092  {
1093  $this->public_comments = $public_comments;
1094  }
+ Here is the caller graph for this function:

◆ setTitle()

ilDataCollectionTable::setTitle (   $a_title)
Parameters
$a_title

Definition at line 330 of file class.ilDataCollectionTable.php.

Referenced by cloneStructure(), and doRead().

330  {
331  $this->title = $a_title;
332  }
+ Here is the caller graph for this function:

◆ setViewOwnRecordsPerm()

ilDataCollectionTable::setViewOwnRecordsPerm (   $view_own_perm)
Parameters
boolean$view_own_perm

Definition at line 1108 of file class.ilDataCollectionTable.php.

Referenced by cloneStructure(), and doRead().

1108  {
1109  $this->view_own_records_perm = (int)$view_own_perm;
1110  }
+ Here is the caller graph for this function:

◆ sortByOrder()

ilDataCollectionTable::sortByOrder ( $array)
protected
Parameters
$arrayilDataCollectionField[] the array to sort

Definition at line 862 of file class.ilDataCollectionTable.php.

Referenced by buildOrderFields(), getFields(), loadFields(), and sortFields().

862  {
863  usort($array, array( $this, "compareOrder" ));
864  }
+ Here is the caller graph for this function:

◆ sortFields()

ilDataCollectionTable::sortFields ( $fields)

sortFields

Parameters
$fieldsilDataCollectionField[]

Definition at line 846 of file class.ilDataCollectionTable.php.

References $fields, and sortByOrder().

846  {
847  $this->sortByOrder($fields);
848  //After sorting the array loses it's keys respectivly their keys are set form $field->id to 1,2,3... so we reset the keys.
849  $named = array();
850  foreach ($fields as $field) {
851  $named[$field->getId()] = $field;
852  }
853 
854  $fields = $named;
855  }
+ Here is the call graph for this function:

◆ updateFields()

ilDataCollectionTable::updateFields ( )

Update fields.

Definition at line 834 of file class.ilDataCollectionTable.php.

References getFields().

834  {
835  foreach ($this->getFields() as $field) {
836  $field->doUpdate();
837  }
838  }
getFields()
Returns all fields of this table including the standard fields.
+ Here is the call graph for this function:

Field Documentation

◆ $add_perm

ilDataCollectionTable::$add_perm
protected

Definition at line 57 of file class.ilDataCollectionTable.php.

Referenced by getAddPerm(), and setAddPerm().

◆ $default_sort_field

ilDataCollectionTable::$default_sort_field = 0
protected

◆ $default_sort_field_order

ilDataCollectionTable::$default_sort_field_order = 'asc'
protected

◆ $delete_perm

ilDataCollectionTable::$delete_perm
protected

Definition at line 65 of file class.ilDataCollectionTable.php.

Referenced by getDeletePerm(), and setDeletePerm().

◆ $description

ilDataCollectionTable::$description = ''
protected

Definition at line 103 of file class.ilDataCollectionTable.php.

Referenced by getDescription(), and setDescription().

◆ $edit_by_owner

ilDataCollectionTable::$edit_by_owner
protected

Definition at line 69 of file class.ilDataCollectionTable.php.

Referenced by getEditByOwner(), and setEditByOwner().

◆ $edit_perm

ilDataCollectionTable::$edit_perm
protected

Definition at line 61 of file class.ilDataCollectionTable.php.

Referenced by getEditPerm(), and setEditPerm().

◆ $export_enabled

ilDataCollectionTable::$export_enabled
protected

Definition at line 85 of file class.ilDataCollectionTable.php.

Referenced by getExportEnabled(), and setExportEnabled().

◆ $fields

◆ $id

ilDataCollectionTable::$id = 0
protected

◆ $is_visible

ilDataCollectionTable::$is_visible
protected

Definition at line 53 of file class.ilDataCollectionTable.php.

Referenced by getIsVisible(), and setIsVisible().

◆ $limit_end

ilDataCollectionTable::$limit_end
protected

Definition at line 81 of file class.ilDataCollectionTable.php.

Referenced by getLimitEnd(), and setLimitEnd().

◆ $limit_start

ilDataCollectionTable::$limit_start
protected

Definition at line 77 of file class.ilDataCollectionTable.php.

Referenced by getLimitStart(), and setLimitStart().

◆ $limited

ilDataCollectionTable::$limited
protected

Definition at line 73 of file class.ilDataCollectionTable.php.

Referenced by getLimited(), and setLimited().

◆ $obj

ilDataCollectionTable::$obj
protected

Definition at line 33 of file class.ilDataCollectionTable.php.

Referenced by getCollectionObject().

◆ $objId

ilDataCollectionTable::$objId
protected

Definition at line 29 of file class.ilDataCollectionTable.php.

Referenced by getObjId().

◆ $public_comments

ilDataCollectionTable::$public_comments = 0
protected

◆ $records

ilDataCollectionTable::$records
protected

◆ $stdFields

ilDataCollectionTable::$stdFields
protected

Definition at line 45 of file class.ilDataCollectionTable.php.

Referenced by getFields().

◆ $title

ilDataCollectionTable::$title
protected

◆ $view_own_records_perm

ilDataCollectionTable::$view_own_records_perm = 0
protected

Definition at line 115 of file class.ilDataCollectionTable.php.

Referenced by getViewOwnRecordsPerm().


The documentation for this class was generated from the following file: