ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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
17{
18
22 protected $dcl_obj_id;
23
24
26 {
28
29 $dclTable = ilDclCache::getTableCache($this->getField()->getTableId());
30 $this->dcl_obj_id = $dclTable->getCollectionObject()->getId();
31 }
32
33
34 public function getStatus()
35 {
36 global $DIC;
37 $ilDB = $DIC['ilDB'];
38 $ilUser = $DIC['ilUser'];
39 $usr_id = $ilUser->getId();
40 $obj_ref = $this->getValue();
41 $obj_id = ilObject2::_lookupObjectId($obj_ref);
42 $query
43 = " SELECT status_changed, status
44 FROM ut_lp_marks
45 WHERE usr_id = " . $usr_id . " AND obj_id = " . $obj_id;
46 $result = $ilDB->query($query);
47
48 return ($result->numRows() == 0) ? false : $result->fetchRow(ilDBConstants::FETCHMODE_OBJECT);
49 }
50
51
55 public function getValueForRepresentation()
56 {
57 $ref_id = $this->getValue();
58
59 return ilObject2::_lookupTitle(ilObject2::_lookupObjectId($ref_id)) . ' [' . $ref_id . ']';
60 }
61
62
66 public function getExportValue()
67 {
68 $link = ilLink::_getStaticLink($this->getValue());
69
70 return $link;
71 }
72}
$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
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$query
global $ilDB
$ilUser
Definition: imgupload.php:18
$DIC
Definition: xapitoken.php:46