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.

71 {
72 if ($a_id != 0) {
73 $this->id = $a_id;
74 $this->doRead();
75 }
76 }

References doRead().

+ 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.

166 {
167 $this->loadRecordFields();
168 $this->recordfields[$field_id]->delete();
169 if (count($this->recordfields) == 1) {
170 $this->doDelete();
171 }
172 }

References doDelete(), and loadRecordFields().

+ 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.

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)

References $file, and ilObject2\_exists().

Referenced by doDelete().

+ 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.

688 {
689 if (ilObject2::_exists($obj_id)) {
690 $mob = new ilObjMediaObject($obj_id);
691 $mob->delete();
692 }
693 }
Class ilObjMediaObject.

References ilObject2\_exists().

Referenced by doDelete().

+ 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.

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 }
getLastUpdate()
Get Last Update Date.
Base class for ILIAS Exception handling.
global $ilDB

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

+ Here is the call graph for this function:

◆ doDelete()

ilDataCollectionRecord::doDelete ( )

Delete.

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

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 }
static sendNotification($a_action, $a_table_id, $a_record_id=NULL)

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

Referenced by deleteField().

+ 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.

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 }
setLastUpdate($a_datetime)
Set Last Update Date.
setCreateDate($a_datetime)
Set Creation Date.

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

Referenced by __construct().

+ 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.

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 }

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

+ 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.

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())

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

+ 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.

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)

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

+ 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.

524 {
525 if ($item = $form->getItemByPostVar('field_' . $field_id)) {
526 $item->setValue($this->getStandardField($field_id));
527 }
528 }

References getStandardField().

Referenced by fillRecordFieldFormInput().

+ 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.

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 }
const IL_NOTE_PUBLIC
Definition: class.ilNote.php:5
_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

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

Referenced by getStandardFieldHTML().

+ 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.

190 {
191 return $this->id;
192 }

References $id.

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

+ 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.

616 {
617 $this->loadRecordFields();
618
619 return $this->recordfields[$field_id];
620 }

References loadRecordFields().

+ 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.

378 {
379 $this->loadRecordFields();
381 return $this->getStandardFieldHTML($field_id);
382 } else {
383 return $this->recordfields[$field_id]->getExportValue();
384 }
385 }

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

+ 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.

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 }
$html
Definition: example_001.php:87
if(!is_array($argv)) $options

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

+ Here is the call graph for this function:

◆ getRecordFields()

ilDataCollectionRecord::getRecordFields ( )
Returns
ilDataCollectionRecordField[]

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

750 {
751 $this->loadRecordFields();
752
753 return $this->recordfields;
754 }

References $recordfields, and loadRecordFields().

Referenced by doUpdate().

+ 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.

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 }

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

+ 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.

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 }

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

Referenced by ilDataCollectionDatatype\passThroughFilter().

+ 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.

330 {
331 $this->loadRecordFields();
332 return $this->recordfields[$field->getId()]->getValueFromExcel($excel, $row, $col);
333 }

References $row, and loadRecordFields().

+ Here is the call graph for this function:

◆ getRecordFieldValues()

ilDataCollectionRecord::getRecordFieldValues ( )
Deprecated:
Returns
array

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

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 }

References $id, and loadRecordFields().

+ 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.

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

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

Referenced by fillStandardFieldFormInput(), and getRecordFieldValue().

+ 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.

558 {
559 switch ($field_id) {
560 case 'id':
561 return $this->getId();
562 case 'owner':
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 }
$_GET["client_id"]
const IL_CAL_DATETIME
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.
getComments()
Get all comments of this record.
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
getListCommentsJSCall($a_hash, $a_update_code=null)
Get list comments js call.
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 getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

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().

+ 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().

+ 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 doCreate(), doDelete(), doUpdate(), 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.

732 {
733 return $this->getTable()->hasPermissionToDeleteRecord($ref_id, $this);
734 }
$ref_id
Definition: sahs_server.php:39

References $ref_id, and getTable().

+ 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.

722 {
723 return $this->getTable()->hasPermissionToEditRecord($ref_id, $this);
724 }

References $ref_id, and getTable().

+ 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.

742 {
743 return $this->getTable()->hasPermissionToViewRecord($ref_id, $this);
744 }

References $ref_id, and getTable().

+ Here is the call graph for this function:

◆ loadRecordFields()

ilDataCollectionRecord::loadRecordFields ( )
private

Load record fields.

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

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)

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

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

+ 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.

604 {
605 if ($this->table == NULL) {
606 $this->table = ilDataCollectionCache::getTableCache($this->getTableId());
607 }
608 }

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

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

+ 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.

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)

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

+ 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.

220 {
221 $this->create_date = $a_datetime;
222 }

Referenced by doRead().

+ 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.

180 {
181 $this->id = $a_id;
182 }

Referenced by doCreate().

+ Here is the caller graph for this function:

◆ setLastEditBy()

ilDataCollectionRecord::setLastEditBy (   $last_edit_by)

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

286 {
287 $this->last_edit_by = $last_edit_by;
288 }

References $last_edit_by.

Referenced by doRead(), and setStandardField().

+ 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.

240 {
241 $this->last_update = $a_datetime;
242 }

Referenced by doRead().

+ 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.

260 {
261 $this->owner = $a_id;
262 }

Referenced by doRead().

+ 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.

297 {
298 $this->loadRecordFields();
300 $this->setStandardField($field_id, $value);
301 } else {
302 $this->loadTable();
303 $this->recordfields[$field_id]->setValue($value);
304 }
305 }

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

+ 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.

313 {
314 $this->loadRecordFields();
316 $this->setStandardFieldFromForm($field_id, $form);
317 } else {
318 $this->loadTable();
319 $this->recordfields[$field_id]->setValueFromForm($form);
320 }
321 }

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

+ 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.

510 {
511 switch ($field_id) {
512 case "last_edit_by":
513 $this->setLastEditBy($value);
514
515 return;
516 }
517 $this->$field_id = $value;
518 }

References setLastEditBy().

Referenced by setRecordFieldValue(), and setStandardFieldFromForm().

+ 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.

500 {
501 if ($item = $form->getItemByPostVar("field_".$field_id)) {
502 $this->setStandardField($item->getValue());
503 }
504 }

References setStandardField().

Referenced by setRecordFieldValueFromForm().

+ 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.

200 {
201 $this->table_id = $a_id;
202 }

Referenced by doRead().

+ 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: