ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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  {
27  parent::__construct($record, $field);
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 }
Class ilDclBaseFieldModel.
static _lookupTitle($a_id)
$result
static _lookupObjectId($a_ref_id)
static getTableCache($table_id=0)
global $DIC
Definition: goto.php:24
$query
Class ilDclBaseRecordModel.
__construct(Container $dic, ilPlugin $plugin)
global $ilDB
$ilUser
Definition: imgupload.php:18
__construct(ilDclBaseRecordModel $record, ilDclBaseFieldModel $field)