ILIAS  release_8 Revision v8.24
class.ilDclIliasReferenceRecordFieldModel.php
Go to the documentation of this file.
1<?php
2
20{
21 protected int $dcl_obj_id;
22
24 {
26
27 $dclTable = ilDclCache::getTableCache($this->getField()->getTableId());
28 $this->dcl_obj_id = $dclTable->getCollectionObject()->getId();
29 }
30
34 public function getStatus()
35 {
36 global $DIC;
37 $ilDB = $DIC['ilDB'];
38 $ilUser = $DIC['ilUser'];
39 $obj_ref = $this->getValue();
40 if (!$obj_ref) {
41 return false;
42 }
43 $usr_id = $ilUser->getId();
44 $obj_id = ilObject2::_lookupObjectId($obj_ref);
45 $query
46 = " SELECT status_changed, status
47 FROM ut_lp_marks
48 WHERE usr_id = " . $usr_id . " AND obj_id = " . $obj_id;
49 $result = $ilDB->query($query);
50
51 return ($result->numRows() == 0) ? false : $result->fetchRow(ilDBConstants::FETCHMODE_OBJECT);
52 }
53
54 public function getValueForRepresentation(): string
55 {
56 $ref_id = $this->getValue();
57
58 if ($ref_id) {
60 } else {
61 return "";
62 }
63 }
64
65 public function getExportValue(): string
66 {
67 $value = (int) $this->getValue();
68 if ($value <= 0) {
69 return '';
70 }
72 }
73}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getTableCache(int $table_id=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(ilDclBaseRecordModel $record, ilDclBaseFieldModel $field)
static _lookupObjectId(int $ref_id)
static _lookupTitle(int $obj_id)
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34
$ref_id
Definition: ltiauth.php:67
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$query