ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 
 getRecordFieldValues ()
 
 getRecordFieldValue ($field_id)
 Get Field Value. More...
 
 getRecordFieldExportValue ($field_id)
 Get Field Export Value. More...
 
 getRecordFieldHTML ($field_id, array $options=array())
 
 getRecordFieldSortingValue ($field_id, array $options=array())
 
 getRecordFieldFormInput ($field_id)
 
 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

 setStandardField ($field_id, $value)
 
 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 610 of file class.ilDataCollectionRecord.php.

References $file, and ilObject2\_exists().

Referenced by doDelete().

610  {
611  if (ilObject2::_exists($obj_id, false)) {
612  $file = new ilObjFile($obj_id, false);
613  $file->delete();
614  }
615  }
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 623 of file class.ilDataCollectionRecord.php.

References ilObject2\_exists().

Referenced by doDelete().

623  {
624  if (ilObject2::_exists($obj_id)) {
625  $mob = new ilObjMediaObject($obj_id);
626  $mob->delete();
627  }
628  }
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 561 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().

561  {
562  global $ilDB;
563 
564  $this->loadRecordFields();
565  foreach ($this->recordfields as $recordfield) {
566  if ($recordfield->getField()->getDatatypeId() == ilDataCollectionDatatype::INPUTFORMAT_FILE) {
567  $this->deleteFile($recordfield->getValue());
568  }
569 
570  if ($recordfield->getField()->getDatatypeId() == ilDataCollectionDatatype::INPUTFORMAT_MOB) {
571  $this->deleteMob($recordfield->getValue());
572  }
573 
574  $recordfield->delete();
575  }
576 
577  $query = "DELETE FROM il_dcl_record WHERE id = " . $ilDB->quote($this->getId(), "integer");
578  $ilDB->manipulate($query);
579 
580  ilObjDataCollection::sendNotification("delete_record", $this->getTableId(), $this->getId());
581  }
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:

◆ getComments()

ilDataCollectionRecord::getComments ( )

Get all comments of this record.

Returns
array ilNote[]

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

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

Referenced by getStandardFieldHTML().

707  {
708  if ($this->comments === NULL) {
709  $this->comments = ilNote::_getNotesOfObject($this->table->getCollectionObject()->getId(), $this->getId(), 'dcl', IL_NOTE_PUBLIC);
710  }
711 
712  return $this->comments;
713  }
_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 ilDataCollectionTable\checkEditByOwner(), doCreate(), 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 551 of file class.ilDataCollectionRecord.php.

References loadRecordFields().

551  {
552  $this->loadRecordFields();
553 
554  return $this->recordfields[$field_id];
555  }
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 350 of file class.ilDataCollectionRecord.php.

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

350  {
351  $this->loadRecordFields();
353  return $this->getStandardFieldHTML($field_id);
354  } else {
355  return $this->recordfields[$field_id]->getExportValue();
356  }
357  }
getStandardFieldHTML($field_id, array $options=array())
loadRecordFields()
Load record fields.
+ Here is the call graph for this function:

◆ getRecordFieldFormInput()

ilDataCollectionRecord::getRecordFieldFormInput (   $field_id)
Parameters
$field_id
Returns
int

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

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

441  {
442  $this->loadRecordFields();
444  return $this->getStandardField($field_id);
445  } else {
446  return $this->recordfields[$field_id]->getFormInput();
447  }
448  }
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 366 of file class.ilDataCollectionRecord.php.

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

366  {
367  $this->loadRecordFields();
369  $html = $this->getStandardFieldHTML($field_id, $options);
370  } else {
371  if (is_object($this->recordfields[$field_id])) {
372  $html = $this->recordfields[$field_id]->getHTML();
373  } else {
374  $html = '';
375  }
376  }
377 
378  // 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
379  // SW 16.07.2014 Uncommented again, as some fields are outputting javascript that was broken due to entity encode the curly brackets
380  // $html = str_ireplace("{", "{", $html);
381  // $html = str_ireplace("}", "}", $html);
382 
383  return $html;
384  }
getStandardFieldHTML($field_id, array $options=array())
if(!is_array($argv)) $options
loadRecordFields()
Load record fields.
+ Here is the call graph for this function:

◆ getRecordFields()

ilDataCollectionRecord::getRecordFields ( )
Returns
ilDataCollectionRecordField[]

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

References $recordfields, and loadRecordFields().

Referenced by doUpdate().

685  {
686  $this->loadRecordFields();
687 
688  return $this->recordfields;
689  }
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 393 of file class.ilDataCollectionRecord.php.

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

393  {
394  $this->loadRecordFields();
396  $sort = $this->getStandardFieldHTML($field_id, $options);
397  } else {
398  if (is_object($this->recordfields[$field_id])) {
399  $sort = $this->recordfields[$field_id]->getSortingValue();
400  } else {
401  $sort = '';
402  }
403  }
404 
405  return $sort;
406  }
getStandardFieldHTML($field_id, array $options=array())
if(!is_array($argv)) $options
loadRecordFields()
Load record fields.
+ 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 330 of file class.ilDataCollectionRecord.php.

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

Referenced by ilDataCollectionDatatype\passThroughFilter().

330  {
331  if ($field_id === NULL) {
332  return NULL;
333  }
334  $this->loadRecordFields();
336  return $this->getStandardField($field_id);
337  } else {
338  return $this->recordfields[$field_id]->getValue();
339  }
340  }
loadRecordFields()
Load record fields.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRecordFieldValues()

ilDataCollectionRecord::getRecordFieldValues ( )
Deprecated:
Returns
array

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

References $id, and loadRecordFields().

312  {
313  $this->loadRecordFields();
314  $return = array();
315  foreach ($this->recordfields as $id => $record_field) {
316  $return[$id] = $record_field->getValue();
317  }
318 
319  return $return;
320  }
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 471 of file class.ilDataCollectionRecord.php.

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

Referenced by getRecordFieldFormInput(), and getRecordFieldValue().

471  {
472  switch ($field_id) {
473  case "last_edit_by":
474  return $this->getLastEditBy();
475  break;
476  case 'owner':
477  $usr_data = ilObjUser::_lookupName($this->getOwner());
478 
479  return $usr_data['login'];
480  break;
481  }
482 
483  return $this->$field_id;
484  }
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 493 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 getRecordFieldExportValue(), getRecordFieldHTML(), and getRecordFieldSortingValue().

493  {
494  switch ($field_id) {
495  case 'id':
496  return $this->getId();
497  case 'owner':
498  return ilUserUtil::getNamePresentation($this->getOwner());
499  case 'last_edit_by':
501  case 'last_update':
503  case 'create_date':
505  case 'comments':
506  $nComments = count($this->getComments());
507  $ajax_hash = ilCommonActionDispatcherGUI::buildAjaxHash(1, $_GET['ref_id'], 'dcl', $this->table->getCollectionObject()
508  ->getId(), 'dcl', $this->getId());
509  $ajax_link = ilNoteGUI::getListCommentsJSCall($ajax_hash, '');
510 
511  return "<a class='dcl_comment' href='#' onclick=\"return " . $ajax_link . "\">
512  <img src='" . ilUtil::getImagePath("comment_unlabeled.svg")
513  . "' alt='{$nComments} Comments'><span class='ilHActProp'>{$nComments}</span></a>";
514  }
515  }
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)
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 695 of file class.ilDataCollectionRecord.php.

References $table, and loadTable().

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

695  {
696  $this->loadTable();
697 
698  return $this->table;
699  }
+ 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 667 of file class.ilDataCollectionRecord.php.

References $ref_id, and getTable().

667  {
668  return $this->getTable()->hasPermissionToDeleteRecord($ref_id, $this);
669  }
$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 657 of file class.ilDataCollectionRecord.php.

References $ref_id, and getTable().

657  {
658  return $this->getTable()->hasPermissionToEditRecord($ref_id, $this);
659  }
$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 677 of file class.ilDataCollectionRecord.php.

References $ref_id, and getTable().

677  {
678  return $this->getTable()->hasPermissionToViewRecord($ref_id, $this);
679  }
$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 521 of file class.ilDataCollectionRecord.php.

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

Referenced by deleteField(), doDelete(), getRecordField(), getRecordFieldExportValue(), getRecordFieldFormInput(), getRecordFieldHTML(), getRecordFields(), getRecordFieldSortingValue(), getRecordFieldValue(), getRecordFieldValues(), and setRecordFieldValue().

521  {
522  if ($this->recordfields == NULL) {
523  $this->loadTable();
524  $recordfields = array();
525  foreach ($this->table->getRecordFields() as $field) {
526  if ($recordfields[$field->getId()] == NULL) {
527  $recordfields[$field->getId()] = ilDataCollectionCache::getRecordFieldCache($this, $field);
528  }
529  }
530 
531  $this->recordfields = $recordfields;
532  }
533  }
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 539 of file class.ilDataCollectionRecord.php.

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

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

539  {
540  if ($this->table == NULL) {
541  $this->table = ilDataCollectionCache::getTableCache($this->getTableId());
542  }
543  }
+ 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 636 of file class.ilDataCollectionRecord.php.

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

636  {
637  $this->loadTable();
638  // If one field returns false, the whole record does not pass the filter #performance-improvements
639  foreach ($this->table->getFilterableFields() as $field) {
640  if (! isset($filter["filter_" . $field->getId()]) || ! $filter["filter_" . $field->getId()]) {
641  continue;
642  }
643  if (! ilDataCollectionDatatype::passThroughFilter($this, $field, $filter["filter_" . $field->getId()])) {
644  return false;
645  }
646  }
647 
648  return true;
649  }
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:

◆ setStandardField()

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

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

References setLastEditBy().

Referenced by setRecordFieldValue().

455  {
456  switch ($field_id) {
457  case "last_edit_by":
458  $this->setLastEditBy($value);
459 
460  return;
461  }
462  $this->$field_id = $value;
463  }
+ 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: