ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilDataCollectionRecord Class Reference

Class ilDataCollectionRecord. More...

+ Collaboration diagram for ilDataCollectionRecord:

Public Member Functions

 __construct ($a_id=0)
 
 doUpdate ()
 doUpdate More...
 
 doRead ()
 Read record. More...
 
 doCreate ()
 
 deleteField ($field_id)
 
 setId ($a_id)
 Set field id. More...
 
 getId ()
 Get field id. More...
 
 setTableId ($a_id)
 Set Table ID. More...
 
 getTableId ()
 Get Table ID. More...
 
 setCreateDate ($a_datetime)
 Set Creation Date. More...
 
 getCreateDate ()
 Get Creation Date. More...
 
 setLastUpdate ($a_datetime)
 Set Last Update Date. More...
 
 getLastUpdate ()
 Get Last Update Date. More...
 
 setOwner ($a_id)
 Set Owner. More...
 
 getOwner ()
 Get Owner. More...
 
 getLastEditBy ()
 
 setLastEditBy ($last_edit_by)
 
 setRecordFieldValue ($field_id, $value)
 Set a field value. More...
 
 setRecordFieldValueFromForm ($field_id, &$form)
 Set a field value. More...
 
 getRecordFieldValueFromExcel ($excel, $row, $col, $field)
 
 getRecordFieldValues ()
 
 getRecordFieldValue ($field_id)
 Get Field Value. More...
 
 getRecordFieldExportValue ($field_id)
 Get Field Export Value. More...
 
 fillRecordFieldExcelExport ($worksheet, &$row, &$col, $field_id)
 
 getRecordFieldHTML ($field_id, array $options=array())
 
 getRecordFieldSortingValue ($field_id, array $options=array())
 
 fillRecordFieldFormInput ($field_id, &$form)
 
 getRecordField ($field_id)
 
 doDelete ()
 Delete. More...
 
 deleteFile ($obj_id)
 Delete a file. More...
 
 deleteMob ($obj_id)
 Delete MOB. More...
 
 passThroughFilter (array $filter)
 
 hasPermissionToEdit ($ref_id)
 
 hasPermissionToDelete ($ref_id)
 
 hasPermissionToView ($ref_id)
 
 getRecordFields ()
 
 getTable ()
 
 getComments ()
 Get all comments of this record. More...
 

Protected Member Functions

 setStandardFieldFromForm ($field_id, &$form)
 
 setStandardField ($field_id, $value)
 
 fillStandardFieldFormInput ($field_id, &$form)
 
 getStandardField ($field_id)
 

Protected Attributes

 $recordfields
 
 $id
 
 $table_id
 
 $table
 
 $last_edit_by
 
 $owner
 
 $last_update
 
 $create_date
 
 $comments
 

Private Member Functions

 getStandardFieldHTML ($field_id, array $options=array())
 
 loadRecordFields ()
 Load record fields. More...
 
 loadTable ()
 Load table. More...
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 71 of file class.ilDataCollectionRecord.php.

References doRead().

71  {
72  if ($a_id != 0) {
73  $this->id = $a_id;
74  $this->doRead();
75  }
76  }
+ Here is the call graph for this function:

Member Function Documentation

◆ deleteField()

ilDataCollectionRecord::deleteField (   $field_id)
Parameters
$field_id

Definition at line 166 of file class.ilDataCollectionRecord.php.

References doDelete(), and loadRecordFields().

166  {
167  $this->loadRecordFields();
168  $this->recordfields[$field_id]->delete();
169  if (count($this->recordfields) == 1) {
170  $this->doDelete();
171  }
172  }
loadRecordFields()
Load record fields.
+ Here is the call graph for this function:

◆ deleteFile()

ilDataCollectionRecord::deleteFile (   $obj_id)

Delete a file.

Parameters
$original_idinteger
$new_fieldsarray($old_field_id => $new_field)
$obj_id

Definition at line 675 of file class.ilDataCollectionRecord.php.

References $file, and ilObject2\_exists().

Referenced by doDelete().

675  {
676  if (ilObject2::_exists($obj_id, false)) {
677  $file = new ilObjFile($obj_id, false);
678  $file->delete();
679  }
680  }
print $file
Class ilObjFile.
static _exists($a_id, $a_reference=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteMob()

ilDataCollectionRecord::deleteMob (   $obj_id)

Delete MOB.

Parameters
$obj_id

Definition at line 688 of file class.ilDataCollectionRecord.php.

References ilObject2\_exists().

Referenced by doDelete().

688  {
689  if (ilObject2::_exists($obj_id)) {
690  $mob = new ilObjMediaObject($obj_id);
691  $mob->delete();
692  }
693  }
Class ilObjMediaObject.
static _exists($a_id, $a_reference=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doCreate()

ilDataCollectionRecord::doCreate ( )
Exceptions
ilException

Definition at line 139 of file class.ilDataCollectionRecord.php.

References $id, $ilDB, $query, ilDataCollectionTable\_tableExists(), getCreateDate(), getId(), getLastEditBy(), getLastUpdate(), getOwner(), getTableId(), and setId().

139  {
140  global $ilDB;
141 
143  throw new ilException("The field does not have a related table!");
144  }
145 
146  $id = $ilDB->nextId("il_dcl_record");
147  $this->setId($id);
148  $query = "INSERT INTO il_dcl_record (
149  id,
150  table_id,
151  create_date,
152  Last_update,
153  owner,
154  last_edit_by
155  ) VALUES (" . $ilDB->quote($this->getId(), "integer") . "," . $ilDB->quote($this->getTableId(), "integer") . ","
156  . $ilDB->quote($this->getCreateDate(), "timestamp") . "," . $ilDB->quote($this->getLastUpdate(), "timestamp") . ","
157  . $ilDB->quote($this->getOwner(), "integer") . "," . $ilDB->quote($this->getLastEditBy(), "integer") . "
158  )";
159  $ilDB->manipulate($query);
160  }
Base class for ILIAS Exception handling.
getLastUpdate()
Get Last Update Date.
global $ilDB
+ Here is the call graph for this function:

◆ doDelete()

ilDataCollectionRecord::doDelete ( )

Delete.

Definition at line 626 of file class.ilDataCollectionRecord.php.

References $ilDB, $query, deleteFile(), deleteMob(), getId(), getTableId(), ilDataCollectionDatatype\INPUTFORMAT_FILE, ilDataCollectionDatatype\INPUTFORMAT_MOB, loadRecordFields(), and ilObjDataCollection\sendNotification().

Referenced by deleteField().

626  {
627  global $ilDB;
628 
629  $this->loadRecordFields();
630  foreach ($this->recordfields as $recordfield) {
631  if ($recordfield->getField()->getDatatypeId() == ilDataCollectionDatatype::INPUTFORMAT_FILE) {
632  $this->deleteFile($recordfield->getValue());
633  }
634 
635  if ($recordfield->getField()->getDatatypeId() == ilDataCollectionDatatype::INPUTFORMAT_MOB) {
636  $this->deleteMob($recordfield->getValue());
637  }
638 
639  $recordfield->delete();
640  }
641 
642  $query = "DELETE FROM il_dcl_record WHERE id = " . $ilDB->quote($this->getId(), "integer");
643  $ilDB->manipulate($query);
644 
645  ilObjDataCollection::sendNotification("delete_record", $this->getTableId(), $this->getId());
646  }
deleteFile($obj_id)
Delete a file.
loadRecordFields()
Load record fields.
global $ilDB
static sendNotification($a_action, $a_table_id, $a_record_id=NULL)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doRead()

ilDataCollectionRecord::doRead ( )

Read record.

Definition at line 120 of file class.ilDataCollectionRecord.php.

References $ilDB, $query, getId(), setCreateDate(), setLastEditBy(), setLastUpdate(), setOwner(), and setTableId().

Referenced by __construct().

120  {
121  global $ilDB;
122  //build query
123  $query = "Select * From il_dcl_record WHERE id = " . $ilDB->quote($this->getId(), "integer") . " ORDER BY id";
124 
125  $set = $ilDB->query($query);
126  $rec = $ilDB->fetchAssoc($set);
127 
128  $this->setTableId($rec["table_id"]);
129  $this->setCreateDate($rec["create_date"]);
130  $this->setLastUpdate($rec["last_update"]);
131  $this->setOwner($rec["owner"]);
132  $this->setLastEditBy($rec["last_edit_by"]);
133  }
setCreateDate($a_datetime)
Set Creation Date.
global $ilDB
setLastUpdate($a_datetime)
Set Last Update Date.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doUpdate()

ilDataCollectionRecord::doUpdate ( )

doUpdate

Definition at line 82 of file class.ilDataCollectionRecord.php.

References $ilDB, getLastEditBy(), getLastUpdate(), getOwner(), getRecordFields(), getTableId(), and ilObjDataCollection\sendNotification().

82  {
83  global $ilDB;
84 
85  $ilDB->update("il_dcl_record", array(
86  "table_id" => array(
87  "integer",
88  $this->getTableId()
89  ),
90  "last_update" => array(
91  "date",
92  $this->getLastUpdate()
93  ),
94  "owner" => array(
95  "text",
96  $this->getOwner()
97  ),
98  "last_edit_by" => array(
99  "text",
100  $this->getLastEditBy()
101  )
102  ), array(
103  "id" => array(
104  "integer",
105  $this->id
106  )
107  ));
108 
109  foreach ($this->getRecordFields() as $recordfield) {
110  $recordfield->doUpdate();
111  }
112 
113  ilObjDataCollection::sendNotification("update_record", $this->getTableId(), $this->id);
114  }
getLastUpdate()
Get Last Update Date.
global $ilDB
static sendNotification($a_action, $a_table_id, $a_record_id=NULL)
+ Here is the call graph for this function:

◆ fillRecordFieldExcelExport()

ilDataCollectionRecord::fillRecordFieldExcelExport (   $worksheet,
$row,
$col,
  $field_id 
)
Parameters
$worksheet
$row
$col
$field_id

Definition at line 393 of file class.ilDataCollectionRecord.php.

References $row, ilDataCollectionStandardField\_isStandardField(), getStandardFieldHTML(), and loadRecordFields().

393  {
394  $this->loadRecordFields();
396  $worksheet->writeString($row, $col, $this->getStandardFieldHTML($field_id));
397  $col++;
398  } else {
399  $this->recordfields[$field_id]->fillExcelExport($worksheet, $row, $col);
400  }
401  }
getStandardFieldHTML($field_id, array $options=array())
loadRecordFields()
Load record fields.
+ Here is the call graph for this function:

◆ fillRecordFieldFormInput()

ilDataCollectionRecord::fillRecordFieldFormInput (   $field_id,
$form 
)
Parameters
$field_id
$formilPropertyFormGUI

Definition at line 486 of file class.ilDataCollectionRecord.php.

References ilDataCollectionStandardField\_isStandardField(), fillStandardFieldFormInput(), and loadRecordFields().

486  {
487  $this->loadRecordFields();
489  $this->fillStandardFieldFormInput($field_id, $form);
490  } else {
491  $this->recordfields[$field_id]->fillFormInput($form);
492  }
493  }
fillStandardFieldFormInput($field_id, &$form)
loadRecordFields()
Load record fields.
+ Here is the call graph for this function:

◆ fillStandardFieldFormInput()

ilDataCollectionRecord::fillStandardFieldFormInput (   $field_id,
$form 
)
protected
Parameters
$field_id
$form

Definition at line 524 of file class.ilDataCollectionRecord.php.

References getStandardField().

Referenced by fillRecordFieldFormInput().

524  {
525  if ($item = $form->getItemByPostVar('field_' . $field_id)) {
526  $item->setValue($this->getStandardField($field_id));
527  }
528  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getComments()

ilDataCollectionRecord::getComments ( )

Get all comments of this record.

Returns
array ilNote[]

Definition at line 772 of file class.ilDataCollectionRecord.php.

References $comments, ilNote\_getNotesOfObject(), getId(), and IL_NOTE_PUBLIC.

Referenced by getStandardFieldHTML().

772  {
773  if ($this->comments === NULL) {
774  $this->comments = ilNote::_getNotesOfObject($this->table->getCollectionObject()->getId(), $this->getId(), 'dcl', IL_NOTE_PUBLIC);
775  }
776 
777  return $this->comments;
778  }
_getNotesOfObject($a_rep_obj_id, $a_obj_id, $a_obj_type, $a_type=IL_NOTE_PRIVATE, $a_incl_sub=false, $a_filter="", $a_all_public="y", $a_repository_mode=true, $a_sort_ascending=false)
get all notes related to a specific object
const IL_NOTE_PUBLIC
Definition: class.ilNote.php:5
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCreateDate()

ilDataCollectionRecord::getCreateDate ( )

Get Creation Date.

Returns
ilDateTime

Definition at line 230 of file class.ilDataCollectionRecord.php.

References $create_date.

Referenced by doCreate(), and getStandardFieldHTML().

+ Here is the caller graph for this function:

◆ getId()

ilDataCollectionRecord::getId ( )

Get field id.

Returns
int

Definition at line 190 of file class.ilDataCollectionRecord.php.

References $id.

Referenced by doCreate(), doDelete(), doRead(), getComments(), and getStandardFieldHTML().

190  {
191  return $this->id;
192  }
+ Here is the caller graph for this function:

◆ getLastEditBy()

ilDataCollectionRecord::getLastEditBy ( )

Definition at line 278 of file class.ilDataCollectionRecord.php.

References $last_edit_by.

Referenced by doCreate(), doUpdate(), getStandardField(), and getStandardFieldHTML().

+ Here is the caller graph for this function:

◆ getLastUpdate()

ilDataCollectionRecord::getLastUpdate ( )

Get Last Update Date.

Returns
ilDateTime

Definition at line 250 of file class.ilDataCollectionRecord.php.

References $last_update.

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

+ Here is the caller graph for this function:

◆ getOwner()

ilDataCollectionRecord::getOwner ( )

Get Owner.

Returns
int

Definition at line 270 of file class.ilDataCollectionRecord.php.

References $owner.

Referenced by doCreate(), ilDataCollectionTable\doesRecordBelongToUser(), doUpdate(), getStandardField(), and getStandardFieldHTML().

+ Here is the caller graph for this function:

◆ getRecordField()

ilDataCollectionRecord::getRecordField (   $field_id)
Parameters
$field_id
Returns
ilDataCollectionRecordField

Definition at line 616 of file class.ilDataCollectionRecord.php.

References loadRecordFields().

616  {
617  $this->loadRecordFields();
618 
619  return $this->recordfields[$field_id];
620  }
loadRecordFields()
Load record fields.
+ Here is the call graph for this function:

◆ getRecordFieldExportValue()

ilDataCollectionRecord::getRecordFieldExportValue (   $field_id)

Get Field Export Value.

Parameters
int$field_id
Returns
array

Definition at line 378 of file class.ilDataCollectionRecord.php.

References ilDataCollectionStandardField\_isStandardField(), getStandardFieldHTML(), and loadRecordFields().

378  {
379  $this->loadRecordFields();
381  return $this->getStandardFieldHTML($field_id);
382  } else {
383  return $this->recordfields[$field_id]->getExportValue();
384  }
385  }
getStandardFieldHTML($field_id, array $options=array())
loadRecordFields()
Load record fields.
+ Here is the call graph for this function:

◆ getRecordFieldHTML()

ilDataCollectionRecord::getRecordFieldHTML (   $field_id,
array  $options = array() 
)
Parameters
$field_id
array$options
Returns
array|mixed|string

Definition at line 409 of file class.ilDataCollectionRecord.php.

References $html, $options, ilDataCollectionStandardField\_isStandardField(), getStandardFieldHTML(), and loadRecordFields().

409  {
410  $this->loadRecordFields();
412  $html = $this->getStandardFieldHTML($field_id, $options);
413  } else {
414  if (is_object($this->recordfields[$field_id])) {
415  $html = $this->recordfields[$field_id]->getHTML();
416  } else {
417  $html = '';
418  }
419  }
420 
421  // This is a workaround as templating in ILIAS currently has some issues with curly brackets.see: http://www.ilias.de/mantis/view.php?id=12681#bugnotes
422  // SW 16.07.2014 Uncommented again, as some fields are outputting javascript that was broken due to entity encode the curly brackets
423  // $html = str_ireplace("{", "{", $html);
424  // $html = str_ireplace("}", "}", $html);
425 
426  return $html;
427  }
getStandardFieldHTML($field_id, array $options=array())
if(!is_array($argv)) $options
loadRecordFields()
Load record fields.
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

◆ getRecordFields()

ilDataCollectionRecord::getRecordFields ( )
Returns
ilDataCollectionRecordField[]

Definition at line 750 of file class.ilDataCollectionRecord.php.

References $recordfields, and loadRecordFields().

Referenced by doUpdate().

750  {
751  $this->loadRecordFields();
752 
753  return $this->recordfields;
754  }
loadRecordFields()
Load record fields.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRecordFieldSortingValue()

ilDataCollectionRecord::getRecordFieldSortingValue (   $field_id,
array  $options = array() 
)
Parameters
$field_id
array$options
Returns
array|mixed|string

Definition at line 436 of file class.ilDataCollectionRecord.php.

References $html, $options, ilDataCollectionStandardField\_isStandardField(), getStandardFieldHTML(), and loadRecordFields().

436  {
437  $this->loadRecordFields();
439  $html = $this->getStandardFieldHTML($field_id, $options);
440  } else {
441  if (is_object($this->recordfields[$field_id])) {
442  $html = $this->recordfields[$field_id]->getSortingValue();
443  } else {
444  $html = '';
445  }
446  }
447 
448  // This is a workaround as templating in ILIAS currently has some issues with curly brackets.see: http://www.ilias.de/mantis/view.php?id=12681#bugnotes
449  // SW 16.07.2014 Uncommented again, as some fields are outputting javascript that was broken due to entity encode the curly brackets
450  // $html = str_ireplace("{", "{", $html);
451  // $html = str_ireplace("}", "}", $html);
452 
453  return $html;
454  }
getStandardFieldHTML($field_id, array $options=array())
if(!is_array($argv)) $options
loadRecordFields()
Load record fields.
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

◆ getRecordFieldValue()

ilDataCollectionRecord::getRecordFieldValue (   $field_id)

Get Field Value.

Parameters
int$field_id
Returns
array

Definition at line 358 of file class.ilDataCollectionRecord.php.

References ilDataCollectionStandardField\_isStandardField(), getStandardField(), and loadRecordFields().

Referenced by ilDataCollectionDatatype\passThroughFilter().

358  {
359  if ($field_id === NULL) {
360  return NULL;
361  }
362  $this->loadRecordFields();
364  return $this->getStandardField($field_id);
365  } else {
366  return $this->recordfields[$field_id]->getValue();
367  }
368  }
loadRecordFields()
Load record fields.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRecordFieldValueFromExcel()

ilDataCollectionRecord::getRecordFieldValueFromExcel (   $excel,
  $row,
  $col,
  $field 
)
Parameters
$excel
$row
$col
$fieldilDataCollectionField
Returns
array|string

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

References $row, and loadRecordFields().

330  {
331  $this->loadRecordFields();
332  return $this->recordfields[$field->getId()]->getValueFromExcel($excel, $row, $col);
333  }
loadRecordFields()
Load record fields.
+ Here is the call graph for this function:

◆ getRecordFieldValues()

ilDataCollectionRecord::getRecordFieldValues ( )
Deprecated:
Returns
array

Definition at line 340 of file class.ilDataCollectionRecord.php.

References $id, and loadRecordFields().

340  {
341  $this->loadRecordFields();
342  $return = array();
343  foreach ($this->recordfields as $id => $record_field) {
344  $return[$id] = $record_field->getValue();
345  }
346 
347  return $return;
348  }
loadRecordFields()
Load record fields.
+ Here is the call graph for this function:

◆ getStandardField()

ilDataCollectionRecord::getStandardField (   $field_id)
protected
Parameters
$field_id
Returns
int

Definition at line 536 of file class.ilDataCollectionRecord.php.

References ilObjUser\_lookupName(), getLastEditBy(), and getOwner().

Referenced by fillStandardFieldFormInput(), and getRecordFieldValue().

536  {
537  switch ($field_id) {
538  case "last_edit_by":
539  return $this->getLastEditBy();
540  break;
541  case 'owner':
542  $usr_data = ilObjUser::_lookupName($this->getOwner());
543 
544  return $usr_data['login'];
545  break;
546  }
547 
548  return $this->$field_id;
549  }
static _lookupName($a_user_id)
lookup user name
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStandardFieldHTML()

ilDataCollectionRecord::getStandardFieldHTML (   $field_id,
array  $options = array() 
)
private
Parameters
string$field_id
array$options
Returns
array|string

Definition at line 558 of file class.ilDataCollectionRecord.php.

References $_GET, ilCommonActionDispatcherGUI\buildAjaxHash(), ilDatePresentation\formatDate(), getComments(), getCreateDate(), getId(), ilUtil\getImagePath(), getLastEditBy(), getLastUpdate(), ilNoteGUI\getListCommentsJSCall(), ilUserUtil\getNamePresentation(), getOwner(), and IL_CAL_DATETIME.

Referenced by fillRecordFieldExcelExport(), getRecordFieldExportValue(), getRecordFieldHTML(), and getRecordFieldSortingValue().

558  {
559  switch ($field_id) {
560  case 'id':
561  return $this->getId();
562  case 'owner':
563  return ilUserUtil::getNamePresentation($this->getOwner());
564  case 'last_edit_by':
566  case 'last_update':
568  case 'create_date':
570  case 'comments':
571  $nComments = count($this->getComments());
572  $ajax_hash = ilCommonActionDispatcherGUI::buildAjaxHash(1, $_GET['ref_id'], 'dcl', $this->table->getCollectionObject()
573  ->getId(), 'dcl', $this->getId());
574  $ajax_link = ilNoteGUI::getListCommentsJSCall($ajax_hash, '');
575 
576  return "<a class='dcl_comment' href='#' onclick=\"return " . $ajax_link . "\">
577  <img src='" . ilUtil::getImagePath("comment_unlabeled.svg")
578  . "' alt='{$nComments} Comments'><span class='ilHActProp'>{$nComments}</span></a>";
579  }
580  }
getComments()
Get all comments of this record.
getListCommentsJSCall($a_hash, $a_update_code=null)
Get list comments js call.
const IL_CAL_DATETIME
$_GET["client_id"]
static getNamePresentation($a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false)
Default behaviour is:
static buildAjaxHash($a_node_type, $a_node_id, $a_obj_type, $a_obj_id, $a_sub_type=null, $a_sub_id=null)
Build ajax hash.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static formatDate(ilDateTime $date)
Format a date public.
Date and time handling
getLastUpdate()
Get Last Update Date.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTable()

ilDataCollectionRecord::getTable ( )
Returns
ilDataCollectionTable

Definition at line 760 of file class.ilDataCollectionRecord.php.

References $table, and loadTable().

Referenced by hasPermissionToDelete(), hasPermissionToEdit(), hasPermissionToView(), and ilDataCollectionRecordListGUI\recordBelongsToCollection().

760  {
761  $this->loadTable();
762 
763  return $this->table;
764  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTableId()

ilDataCollectionRecord::getTableId ( )

Get Table ID.

Returns
int

Definition at line 210 of file class.ilDataCollectionRecord.php.

References $table_id.

Referenced by ilDataCollectionRecordViewGUI\_getViewDefinitionId(), doCreate(), doDelete(), doUpdate(), ilDataCollectionRecordViewGUI\hasValidViewDefinition(), and loadTable().

+ Here is the caller graph for this function:

◆ hasPermissionToDelete()

ilDataCollectionRecord::hasPermissionToDelete (   $ref_id)
Parameters
int$ref_id
Returns
bool

Definition at line 732 of file class.ilDataCollectionRecord.php.

References $ref_id, and getTable().

732  {
733  return $this->getTable()->hasPermissionToDeleteRecord($ref_id, $this);
734  }
$ref_id
Definition: sahs_server.php:39
+ Here is the call graph for this function:

◆ hasPermissionToEdit()

ilDataCollectionRecord::hasPermissionToEdit (   $ref_id)
Parameters
int$ref_id
Returns
bool

Definition at line 722 of file class.ilDataCollectionRecord.php.

References $ref_id, and getTable().

722  {
723  return $this->getTable()->hasPermissionToEditRecord($ref_id, $this);
724  }
$ref_id
Definition: sahs_server.php:39
+ Here is the call graph for this function:

◆ hasPermissionToView()

ilDataCollectionRecord::hasPermissionToView (   $ref_id)
Parameters
$ref_id
Returns
bool

Definition at line 742 of file class.ilDataCollectionRecord.php.

References $ref_id, and getTable().

742  {
743  return $this->getTable()->hasPermissionToViewRecord($ref_id, $this);
744  }
$ref_id
Definition: sahs_server.php:39
+ Here is the call graph for this function:

◆ loadRecordFields()

ilDataCollectionRecord::loadRecordFields ( )
private

Load record fields.

Definition at line 586 of file class.ilDataCollectionRecord.php.

References $recordfields, ilDataCollectionCache\getRecordFieldCache(), and loadTable().

Referenced by deleteField(), doDelete(), fillRecordFieldExcelExport(), fillRecordFieldFormInput(), getRecordField(), getRecordFieldExportValue(), getRecordFieldHTML(), getRecordFields(), getRecordFieldSortingValue(), getRecordFieldValue(), getRecordFieldValueFromExcel(), getRecordFieldValues(), setRecordFieldValue(), and setRecordFieldValueFromForm().

586  {
587  if ($this->recordfields == NULL) {
588  $this->loadTable();
589  $recordfields = array();
590  foreach ($this->table->getRecordFields() as $field) {
591  if ($recordfields[$field->getId()] == NULL) {
592  $recordfields[$field->getId()] = ilDataCollectionCache::getRecordFieldCache($this, $field);
593  }
594  }
595 
596  $this->recordfields = $recordfields;
597  }
598  }
static getRecordFieldCache($record, $field)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadTable()

ilDataCollectionRecord::loadTable ( )
private

Load table.

Definition at line 604 of file class.ilDataCollectionRecord.php.

References ilDataCollectionCache\getTableCache(), and getTableId().

Referenced by getTable(), loadRecordFields(), passThroughFilter(), setRecordFieldValue(), and setRecordFieldValueFromForm().

604  {
605  if ($this->table == NULL) {
606  $this->table = ilDataCollectionCache::getTableCache($this->getTableId());
607  }
608  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ passThroughFilter()

ilDataCollectionRecord::passThroughFilter ( array  $filter)
Parameters
array$filter
Returns
bool

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

References loadTable(), and ilDataCollectionDatatype\passThroughFilter().

701  {
702  $this->loadTable();
703  // If one field returns false, the whole record does not pass the filter #performance-improvements
704  foreach ($this->table->getFilterableFields() as $field) {
705  if (! isset($filter["filter_" . $field->getId()]) || ! $filter["filter_" . $field->getId()]) {
706  continue;
707  }
708  if (! ilDataCollectionDatatype::passThroughFilter($this, $field, $filter["filter_" . $field->getId()])) {
709  return false;
710  }
711  }
712 
713  return true;
714  }
static passThroughFilter(ilDataCollectionRecord $record, ilDataCollectionField $field, $filter)
+ Here is the call graph for this function:

◆ setCreateDate()

ilDataCollectionRecord::setCreateDate (   $a_datetime)

Set Creation Date.

Parameters
ilDateTime$a_datetime

Definition at line 220 of file class.ilDataCollectionRecord.php.

Referenced by doRead().

220  {
221  $this->create_date = $a_datetime;
222  }
+ Here is the caller graph for this function:

◆ setId()

ilDataCollectionRecord::setId (   $a_id)

Set field id.

Parameters
int$a_id

Definition at line 180 of file class.ilDataCollectionRecord.php.

Referenced by doCreate().

180  {
181  $this->id = $a_id;
182  }
+ Here is the caller graph for this function:

◆ setLastEditBy()

ilDataCollectionRecord::setLastEditBy (   $last_edit_by)

Definition at line 286 of file class.ilDataCollectionRecord.php.

References $last_edit_by.

Referenced by doRead(), and setStandardField().

286  {
287  $this->last_edit_by = $last_edit_by;
288  }
+ Here is the caller graph for this function:

◆ setLastUpdate()

ilDataCollectionRecord::setLastUpdate (   $a_datetime)

Set Last Update Date.

Parameters
ilDateTime$a_datetime

Definition at line 240 of file class.ilDataCollectionRecord.php.

Referenced by doRead().

240  {
241  $this->last_update = $a_datetime;
242  }
+ Here is the caller graph for this function:

◆ setOwner()

ilDataCollectionRecord::setOwner (   $a_id)

Set Owner.

Parameters
int$a_id

Definition at line 260 of file class.ilDataCollectionRecord.php.

Referenced by doRead().

260  {
261  $this->owner = $a_id;
262  }
+ Here is the caller graph for this function:

◆ setRecordFieldValue()

ilDataCollectionRecord::setRecordFieldValue (   $field_id,
  $value 
)

Set a field value.

Parameters
int$field_id
string$value

Definition at line 297 of file class.ilDataCollectionRecord.php.

References ilDataCollectionStandardField\_isStandardField(), loadRecordFields(), loadTable(), and setStandardField().

297  {
298  $this->loadRecordFields();
300  $this->setStandardField($field_id, $value);
301  } else {
302  $this->loadTable();
303  $this->recordfields[$field_id]->setValue($value);
304  }
305  }
loadRecordFields()
Load record fields.
+ Here is the call graph for this function:

◆ setRecordFieldValueFromForm()

ilDataCollectionRecord::setRecordFieldValueFromForm (   $field_id,
$form 
)

Set a field value.

Parameters
int$field_id
string$value

Definition at line 313 of file class.ilDataCollectionRecord.php.

References ilDataCollectionStandardField\_isStandardField(), loadRecordFields(), loadTable(), and setStandardFieldFromForm().

313  {
314  $this->loadRecordFields();
316  $this->setStandardFieldFromForm($field_id, $form);
317  } else {
318  $this->loadTable();
319  $this->recordfields[$field_id]->setValueFromForm($form);
320  }
321  }
loadRecordFields()
Load record fields.
+ Here is the call graph for this function:

◆ setStandardField()

ilDataCollectionRecord::setStandardField (   $field_id,
  $value 
)
protected
Parameters
$field_id
$value

Definition at line 510 of file class.ilDataCollectionRecord.php.

References setLastEditBy().

Referenced by setRecordFieldValue(), and setStandardFieldFromForm().

510  {
511  switch ($field_id) {
512  case "last_edit_by":
513  $this->setLastEditBy($value);
514 
515  return;
516  }
517  $this->$field_id = $value;
518  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setStandardFieldFromForm()

ilDataCollectionRecord::setStandardFieldFromForm (   $field_id,
$form 
)
protected
Parameters
$field_id
ilPropertyFormGUI$form

Definition at line 500 of file class.ilDataCollectionRecord.php.

References setStandardField().

Referenced by setRecordFieldValueFromForm().

500  {
501  if ($item = $form->getItemByPostVar("field_".$field_id)) {
502  $this->setStandardField($item->getValue());
503  }
504  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTableId()

ilDataCollectionRecord::setTableId (   $a_id)

Set Table ID.

Parameters
int$a_id

Definition at line 200 of file class.ilDataCollectionRecord.php.

Referenced by doRead().

200  {
201  $this->table_id = $a_id;
202  }
+ Here is the caller graph for this function:

Field Documentation

◆ $comments

ilDataCollectionRecord::$comments
protected

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

Referenced by getComments().

◆ $create_date

ilDataCollectionRecord::$create_date
protected

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

Referenced by getCreateDate().

◆ $id

ilDataCollectionRecord::$id
protected

Definition at line 35 of file class.ilDataCollectionRecord.php.

Referenced by doCreate(), getId(), and getRecordFieldValues().

◆ $last_edit_by

ilDataCollectionRecord::$last_edit_by
protected

Definition at line 49 of file class.ilDataCollectionRecord.php.

Referenced by getLastEditBy(), and setLastEditBy().

◆ $last_update

ilDataCollectionRecord::$last_update
protected

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

Referenced by getLastUpdate().

◆ $owner

ilDataCollectionRecord::$owner
protected

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

Referenced by getOwner().

◆ $recordfields

ilDataCollectionRecord::$recordfields
protected

Definition at line 31 of file class.ilDataCollectionRecord.php.

Referenced by getRecordFields(), and loadRecordFields().

◆ $table

ilDataCollectionRecord::$table
protected

Definition at line 43 of file class.ilDataCollectionRecord.php.

Referenced by getTable().

◆ $table_id

ilDataCollectionRecord::$table_id
protected

Definition at line 39 of file class.ilDataCollectionRecord.php.

Referenced by getTableId().


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