ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilDclIliasReferenceRecordFieldModel.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5require_once './Modules/DataCollection/classes/Fields/Base/class.ilDclBaseRecordFieldModel.php';
6require_once './Services/Object/classes/class.ilObject2.php';
7
20{
21
25 protected $dcl_obj_id;
26
27
29 {
30 parent::__construct($record, $field);
31
32 $dclTable = ilDclCache::getTableCache($this->getField()->getTableId());
33 $this->dcl_obj_id = $dclTable->getCollectionObject()->getId();
34 }
35
36
37 public function getStatus()
38 {
39 global $DIC;
40 $ilDB = $DIC['ilDB'];
41 $ilUser = $DIC['ilUser'];
42 $usr_id = $ilUser->getId();
43 $obj_ref = $this->getValue();
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
58 public function getValueForRepresentation()
59 {
60 $ref_id = $this->getValue();
61
62 return ilObject2::_lookupTitle(ilObject2::_lookupObjectId($ref_id)) . ' [' . $ref_id . ']';
63 }
64
65
69 public function getExportValue()
70 {
71 $link = ilLink::_getStaticLink($this->getValue());
72
73 return $link;
74 }
75}
$result
An exception for terminatinating execution or to throw for unit testing.
Class ilDclBaseFieldModel.
Class ilDclBaseRecordModel.
static getTableCache($table_id=0)
__construct(ilDclBaseRecordModel $record, ilDclBaseFieldModel $field)
static _lookupTitle($a_id)
lookup object title
static _lookupObjectId($a_ref_id)
lookup object id
$query
global $DIC
Definition: saml.php:7
global $ilDB
$ilUser
Definition: imgupload.php:18