ILIAS  trunk Revision v11.0_alpha-1731-gff9cd7e2bd3
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilDclIliasReferenceRecordFieldModel.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 {
23  protected int $dcl_obj_id;
24 
26  {
27  parent::__construct($record, $field);
28 
29  $dclTable = ilDclCache::getTableCache($this->getField()->getTableId());
30  $this->dcl_obj_id = $dclTable->getCollectionObject()->getId();
31  }
32 
33  public function getStatus(): ?stdClass
34  {
35  $obj_ref = $this->getValue();
36  if (!$obj_ref) {
37  return null;
38  }
39  $usr_id = $this->user->getId();
40  $obj_id = ilObject2::_lookupObjectId($obj_ref);
41  $query = " SELECT status_changed, status
42  FROM ut_lp_marks
43  WHERE usr_id = " . $usr_id . " AND obj_id = " . $obj_id;
44 
45  return $this->db->fetchObject($this->db->query($query));
46  }
47 
48  public function getValueForRepresentation(): string
49  {
50  $ref_id = $this->getValue();
51 
52  if ($ref_id) {
54  } else {
55  return "";
56  }
57  }
58 
59  public function getExportValue(): string
60  {
61  $value = (int) $this->getValue();
62  if ($value <= 0) {
63  return '';
64  }
66  }
67 }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$ref_id
Definition: ltiauth.php:65
static _lookupTitle(int $obj_id)
static _lookupObjectId(int $ref_id)
static getTableCache(?int $table_id=null)
__construct(Container $dic, ilPlugin $plugin)
__construct(ilDclBaseRecordModel $record, ilDclBaseFieldModel $field)